comparison test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll @ 0:95c75e76d11b LLVM3.4

LLVM 3.4
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Thu, 12 Dec 2013 13:56:28 +0900
parents
children afa8332a0e37
comparison
equal deleted inserted replaced
-1:000000000000 0:95c75e76d11b
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.
3
4 ; RUN: opt < %s -mem2reg -S | not grep phi
5
6 define void @test(i32 %B, i1 %C) {
7 %A = alloca i32 ; <i32*> [#uses=4]
8 store i32 %B, i32* %A
9 br i1 %C, label %L1, label %L2
10 L1: ; preds = %0
11 store i32 %B, i32* %A
12 %D = load i32* %A ; <i32> [#uses=1]
13 call void @test( i32 %D, i1 false )
14 br label %L3
15 L2: ; preds = %0
16 %E = load i32* %A ; <i32> [#uses=1]
17 call void @test( i32 %E, i1 true )
18 br label %L3
19 L3: ; preds = %L2, %L1
20 ret void
21 }
22