blob: a9b87fd1f475ef998fc1e9da2de4c42cce999ad4 [file] [log] [blame]
Chris Lattner0ac801e2003-10-05 21:11:57 +00001; Mem2reg should not insert dead PHI nodes! The naive algorithm inserts a PHI
2; node in L3, even though there is no load of %A in anything dominated by L3.
3
4; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep phi
5
6void %test(int %B, bool %C) {
7 %A = alloca int
8 store int %B, int* %A
9 br bool %C, label %L1, label %L2
10L1:
11 store int %B, int* %A
12 %D = load int* %A
13 call void %test(int %D, bool false)
14 br label %L3
15L2:
16 %E = load int* %A
17 call void %test(int %E, bool true)
18 br label %L3
19L3:
20 ret void
21}