44 lines · plain
1; REQUIRES: asserts2; RUN: llc < %s -mtriple=thumbv7-apple-ios -arm-atomic-cfg-tidy=0 -stats 2>&1 | FileCheck %s3 4; If ARMBaseInstrInfo::AnalyzeBlocks returns the wrong value, which was possible5; for blocks with indirect branches, the IfConverter could end up deleting6; blocks that were the destinations of indirect branches, leaving branches to7; nowhere.8; <rdar://problem/14464830>9 10define i32 @preserve_blocks(i32 %x) {11; preserve_blocks:12; CHECK: Block address taken13; CHECK: %ibt114; CHECK: movs r0, #215; CHECK: Block address taken16; CHECK: %ibt217; CHECK: movs r0, #118; CHECK-NOT: Address of block that was removed by CodeGen19 20; Separate bug. There are no valid diamonds to if-convert in this file.21; There was a bug in the if-conversion code that would if-convert a false22; diamond where one side had a return and the other had an indirect branch.23; Make sure no diamond conversions occurred while compiling this file.24; CHECK: Statistics Collected25; CHECK-NOT: 1 ifcvt - Number of diamond if-conversions performed26entry:27 %c2 = icmp slt i32 %x, 328 %blockaddr = select i1 %c2, ptr blockaddress(@preserve_blocks, %ibt1), ptr blockaddress(@preserve_blocks, %ibt2)29 %c1 = icmp eq i32 %x, 030 br i1 %c1, label %pre_ib, label %nextblock31 32nextblock:33 ret i32 334 35ibt1:36 ret i32 237 38ibt2:39 ret i32 140 41pre_ib:42 indirectbr ptr %blockaddr, [ label %ibt1, label %ibt2 ]43}44