1- ; RUN: opt < %s -passes=instcombine,mem2reg,simplifycfg -simplifycfg-require-and-preserve-domtree=1 | \
2- ; RUN: llvm-dis | grep -v store | not grep "i32 1"
1+ ; RUN: opt %s -passes=instcombine,mem2reg,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S \
2+ ; RUN: | grep -v store | not grep "i32 1"
3+ ; RUN: opt %s -passes=instcombine,mem2reg,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
34
45; Test to make sure that instcombine does not accidentally propagate the load
56; into the PHI, which would break the program.
67
7- define i32 @test (i1 %C ) {
8+ define i32 @test (i1 %C ) !prof !0 {
89entry:
910 %X = alloca i32 ; <ptr> [#uses=3]
1011 %X2 = alloca i32 ; <ptr> [#uses=2]
1112 store i32 1 , ptr %X
1213 store i32 2 , ptr %X2
13- br i1 %C , label %cond_true.i , label %cond_continue.i
14+ br i1 %C , label %cond_true.i , label %cond_continue.i , !prof !1
1415
1516cond_true.i: ; preds = %entry
1617 br label %cond_continue.i
@@ -22,4 +23,7 @@ cond_continue.i: ; preds = %cond_true.i, %entry
2223 ret i32 %tmp.3
2324}
2425
26+ ; CHECK: %spec.select = select i1 %C, ptr %X, ptr %X2, !prof !1
2527
28+ !0 = !{!"function_entry_count" , i64 1000 }
29+ !1 = !{!"branch_weights" , i32 2 , i32 7 }
0 commit comments