Skip to content

Commit 0139719

Browse files
committed
[InstCombine] Make test resilient to metadata presence
1 parent f2d827c commit 0139719

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
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 {
89
entry:
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

1516
cond_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}

llvm/utils/profcheck-xfail.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,6 @@ Transforms/IndVarSimplify/invalidate-modified-lcssa-phi.ll
831831
Transforms/IndVarSimplify/pr45835.ll
832832
Transforms/IndVarSimplify/preserving-debugloc-rem-div.ll
833833
Transforms/Inline/optimization-remarks-hotness-threshold.ll
834-
Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll
835834
Transforms/InstCombine/2004-09-20-BadLoadCombine.ll
836835
Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll
837836
Transforms/InstCombine/2011-02-14-InfLoop.ll

0 commit comments

Comments
 (0)