60 lines · plain
1; RUN: llc < %s -mtriple=thumbv7-apple-ios2 3; If converter was being too cute. It look for root BBs (which don't have4; successors) and use inverse depth first search to traverse the BBs. However5; that doesn't work when the CFG has infinite loops. Simply do a linear6; traversal of all BBs work just fine.7 8; rdar://93446459 10%struct.hc = type { i32, i32, i32, i32 }11 12define i32 @t(i32 %type) optsize {13entry:14 br i1 undef, label %if.then, label %if.else15 16if.then:17 unreachable18 19if.else:20 br i1 undef, label %if.then15, label %if.else1821 22if.then15:23 unreachable24 25if.else18:26 switch i32 %type, label %if.else173 [27 i32 3, label %if.then11528 i32 1, label %if.then10229 ]30 31if.then102:32 br i1 undef, label %cond.true10.i, label %t.exit33 34cond.true10.i:35 br label %t.exit36 37t.exit:38 unreachable39 40if.then115:41 br i1 undef, label %if.else163, label %if.else14542 43if.else145:44 %call150 = call fastcc ptr @foo(ptr undef, i32 34865152) optsize45 br label %while.body17246 47if.else163:48 %call168 = call fastcc ptr @foo(ptr undef, i32 34078720) optsize49 br label %while.body17250 51while.body172:52 br label %while.body17253 54if.else173:55 ret i32 -156}57 58declare hidden fastcc ptr @foo(ptr nocapture, i32) nounwind optsize59 60