diff options
Diffstat (limited to 'llvm/test/CodeGen/X86/loop-blocks.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/loop-blocks.ll | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/loop-blocks.ll b/llvm/test/CodeGen/X86/loop-blocks.ll index 1a1d11e6cb3..fc6a357523f 100644 --- a/llvm/test/CodeGen/X86/loop-blocks.ll +++ b/llvm/test/CodeGen/X86/loop-blocks.ll @@ -228,6 +228,41 @@ done: ret void } +; This is exactly the same function as slightly_more_involved. +; The difference is that when optimising for size, we do not want +; to see this reordering. + +; CHECK-LABEL: slightly_more_involved_2: +; CHECK-NOT: jmp .LBB5_1 +; CHECK: .LBB5_1: +; CHECK-NEXT: callq body + +define void @slightly_more_involved_2() #0 { +entry: + br label %loop + +loop: + call void @body() + %t0 = call i32 @get() + %t1 = icmp slt i32 %t0, 2 + br i1 %t1, label %block_a, label %bb + +bb: + %t2 = call i32 @get() + %t3 = icmp slt i32 %t2, 99 + br i1 %t3, label %exit, label %loop + +block_a: + call void @bar99() + br label %loop + +exit: + call void @exit() + ret void +} + +attributes #0 = { minsize norecurse nounwind optsize readnone uwtable } + declare void @bar99() nounwind declare void @bar100() nounwind declare void @bar101() nounwind |