1 ; 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.
4 ; RUN: opt < %s -mem2reg -S | not grep phi
6 define void @test(i32 %B, i1 %C) {
7 %A = alloca i32 ; <i32*> [#uses=4]
9 br i1 %C, label %L1, label %L2
12 %D = load i32, i32* %A ; <i32> [#uses=1]
13 call void @test( i32 %D, i1 false )
16 %E = load i32, i32* %A ; <i32> [#uses=1]
17 call void @test( i32 %E, i1 true )
19 L3: ; preds = %L2, %L1