1; REQUIRES: asserts 2; RUN: llc < %s -mtriple=thumbv7-apple-ios -arm-atomic-cfg-tidy=0 -stats 2>&1 | FileCheck %s 3 4; If ARMBaseInstrInfo::AnalyzeBlocks returns the wrong value, which was possible 5; for blocks with indirect branches, the IfConverter could end up deleting 6; blocks that were the destinations of indirect branches, leaving branches to 7; nowhere. 8; <rdar://problem/14464830> 9 10define i32 @preserve_blocks(i32 %x) { 11; preserve_blocks: 12; CHECK: Block address taken 13; CHECK: movs r0, #1 14; CHECK: Block address taken 15; CHECK: movs r0, #2 16; CHECK-NOT: Address of block that was removed by CodeGen 17 18; Separate bug. There are no valid diamonds to if-convert in this file. 19; There was a bug in the if-conversion code that would if-convert a false 20; diamond where one side had a return and the other had an indirect branch. 21; Make sure no diamond conversions occurred while compiling this file. 22; CHECK: Statistics Collected 23; CHECK-NOT: 1 ifcvt - Number of diamond if-conversions performed 24entry: 25 %c2 = icmp slt i32 %x, 3 26 %blockaddr = select i1 %c2, i8* blockaddress(@preserve_blocks, %ibt1), i8* blockaddress(@preserve_blocks, %ibt2) 27 %c1 = icmp eq i32 %x, 0 28 br i1 %c1, label %pre_ib, label %nextblock 29 30nextblock: 31 ret i32 3 32 33ibt1: 34 ret i32 2 35 36ibt2: 37 ret i32 1 38 39pre_ib: 40 indirectbr i8* %blockaddr, [ label %ibt1, label %ibt2 ] 41} 42