74 lines · plain
1; RUN: opt < %s -S -passes="default<O1>" | FileCheck %s -check-prefixes=TRIVIAL,CHECK2; RUN: opt < %s -S -passes="default<O2>" | FileCheck %s -check-prefixes=TRIVIAL,CHECK3; RUN: opt < %s -S -passes="default<O3>" | FileCheck %s -check-prefixes=NONTRIVIAL,CHECK4; RUN: opt < %s -S -passes="default<Os>" | FileCheck %s -check-prefixes=TRIVIAL,CHECK5; RUN: opt < %s -S -passes="default<Oz>" | FileCheck %s -check-prefixes=TRIVIAL,CHECK6 7declare i32 @a()8declare i32 @b()9declare i32 @c()10 11; TRIVIAL-NOT: loop_begin.us:12; NONTRIVIAL: loop_begin.us:13 14define i32 @test1(ptr %ptr, i1 %cond1, i1 %cond2) {15entry:16 br label %loop_begin17 18loop_begin:19 br i1 %cond1, label %loop_a, label %loop_b20 21loop_a:22 call i32 @a()23 br label %latch24 25loop_b:26 br i1 %cond2, label %loop_b_a, label %loop_b_b27 28loop_b_a:29 call i32 @b()30 br label %latch31 32loop_b_b:33 call i32 @c()34 br label %latch35 36latch:37 %v = load i1, ptr %ptr38 br i1 %v, label %loop_begin, label %loop_exit39 40loop_exit:41 ret i32 042}43 44; CHECK-NOT: loop2_begin.us:45define i32 @test2(ptr %ptr, i1 %cond1, i1 %cond2) optsize {46entry:47 br label %loop2_begin48 49loop2_begin:50 br i1 %cond1, label %loop2_a, label %loop2_b51 52loop2_a:53 call i32 @a()54 br label %latch255 56loop2_b:57 br i1 %cond2, label %loop2_b_a, label %loop2_b_b58 59loop2_b_a:60 call i32 @b()61 br label %latch262 63loop2_b_b:64 call i32 @c()65 br label %latch266 67latch2:68 %v = load i1, ptr %ptr69 br i1 %v, label %loop2_begin, label %loop2_exit70 71loop2_exit:72 ret i32 073}74