llvm.org GIT mirror llvm / 5b15dee
new testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8882 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
1 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; Mem2reg should not insert dead PHI nodes! The naive algorithm inserts a PHI
1 ; node in L3, even though there is no load of %A in anything dominated by L3.
2
3 ; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep phi
4
5 void %test(int %B, bool %C) {
6 %A = alloca int
7 store int %B, int* %A
8 br bool %C, label %L1, label %L2
9 L1:
10 store int %B, int* %A
11 %D = load int* %A
12 call void %test(int %D, bool false)
13 br label %L3
14 L2:
15 %E = load int* %A
16 call void %test(int %E, bool true)
17 br label %L3
18 L3:
19 ret void
20 }