56 lines · plain
1; RUN: opt < %s -debug-pass-manager -passes='require<domtree>,loop(loop-simplifycfg),gvn,loop(indvars)' 2>&1 -S | FileCheck --check-prefix=NEW-PM --check-prefix=IR %s2 3; Check CFG-only analysis are preserved by SCCP by running it between 24; loop-vectorize runs.5 6; CHECK: Dominator Tree Construction7; CHECK: Natural Loop Information8; CHECK: Canonicalize natural loops9; CHECK: LCSSA Verifier10; CHECK: Loop-Closed SSA Form Pass11; CHECK: Global Value Numbering12; CHECK-NOT: Dominator Tree Construction13; CHECK-NOT: Natural Loop Information14; CHECK: Canonicalize natural loops15 16; NEW-PM-DAG: Running analysis: LoopAnalysis on test17; NEW-PM-DAG: Running analysis: DominatorTreeAnalysis on test18; NEW-PM: Running pass: GVNPass on test19; NEW-PM-NOT: Running analysis: LoopAnalysis on test20; NEW-PM-NOT: Running analysis: DominatorTreeAnalysis on test21 22declare i1 @cond()23declare void @dostuff()24 25define i32 @test() {26; IR-LABEL: define i32 @test()27; IR-LABEL: header:28; IR: br i1 false, label %then, label %latch29; IR-LABEL: then:30; IR-NEXT: call void @dostuff()31; IR-NEXT: br label %latch32entry:33 %res = add i32 1, 1034 br label %header35 36header:37 %iv = phi i32 [ %res, %entry ], [ 0, %latch ]38 %ic = icmp eq i32 %res, 9939 br i1 %ic, label %then, label %latch40 41then:42 br label %then.243 44then.2:45 call void @dostuff()46 br label %latch47 48 49latch:50 %ec = call i1 @cond()51 br i1 %ec, label %exit, label %header52 53exit:54 ret i32 %iv55}56