brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 6c4f0c0 Raw
58 lines · plain
1; RUN: opt -S -O1 < %s -o %t1.ll2; RUN: opt -S < %t1.ll -o %t2.ll3; RUN: opt -S -passes=simplifycfg < %t1.ll -o %t3.ll4;; Show that there's no difference after running another simplify CFG5; RUN: diff %t2.ll %t3.ll6 7; Test from LoopSink pass, leaves some single-entry single-exit basic blocks.8; After LoopSink, we get a basic block .exit.loopexit which has one entry and9; one exit, the only instruction is a branch. Make sure it doesn't show up.10; Make sure they disappear at -O1.11 12@g = global i32 0, align 413 14define i32 @t1(i32, i32) {15  %3 = icmp eq i32 %1, 016  br i1 %3, label %.exit, label %.preheader17 18.preheader:19  %invariant = load i32, ptr @g20  br label %.b121 22.b1:23  %iv = phi i32 [ %t7, %.b7 ], [ 0, %.preheader ]24  %c1 = icmp sgt i32 %iv, %025  br i1 %c1, label %.b2, label %.b626 27.b2:28  %c2 = icmp sgt i32 %iv, 129  br i1 %c2, label %.b3, label %.b430 31.b3:32  %t3 = sub nsw i32 %invariant, %iv33  br label %.b534 35.b4:36  %t4 = add nsw i32 %invariant, %iv37  br label %.b538 39.b5:40  %p5 = phi i32 [ %t3, %.b3 ], [ %t4, %.b4 ]41  %t5 = mul nsw i32 %p5, 542  br label %.b743 44.b6:45  %t6 = add nsw i32 %iv, 10046  br label %.b747 48.b7:49  %p7 = phi i32 [ %t6, %.b6 ], [ %t5, %.b5 ]50  %t7 = add nuw nsw i32 %iv, 151  %c7 = icmp eq i32 %t7, %p752  br i1 %c7, label %.b1, label %.exit53 54.exit:55  ret i32 1056}57 58