xref: /llvm-project/llvm/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll (revision d1d129356909af2f6fefd6f1b9335a39fe172e9a)
1; CFG Simplification is making a loop dead, then changing the add into:
2;
3;   %V1 = add int %V1, 1
4;
5; Which is not valid SSA
6;
7; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 | llvm-dis
8
9define void @test() {
10; <label>:0
11	br i1 true, label %end, label %Loop
12Loop:		; preds = %Loop, %0
13	%V = phi i32 [ 0, %0 ], [ %V1, %Loop ]		; <i32> [#uses=1]
14	%V1 = add i32 %V, 1		; <i32> [#uses=1]
15	br label %Loop
16end:		; preds = %0
17	ret void
18}
19
20