blob: 055386b3475197ea6966bc4302501abc25ca7dae [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; 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;
Dan Gohman3c7d3082009-09-11 18:01:28 +00007; RUN: opt < %s -simplifycfg | llvm-dis
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008
Tanya Lattner003eae52008-03-10 07:21:50 +00009define 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]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000015 br label %Loop
Tanya Lattner003eae52008-03-10 07:21:50 +000016end: ; preds = %0
Dan Gohmanf17a25c2007-07-18 16:29:46 +000017 ret void
18}
Tanya Lattner003eae52008-03-10 07:21:50 +000019