blob: 3b92c25389b0a56e96319aaa508179963735ee88 [file] [log] [blame]
Eric Christophercee313d2019-04-17 04:52:47 +00001; Check that this test makes INDVAR and related stuff dead.
2; RUN: opt < %s -loop-reduce -S | not grep INDVAR
3
4; Provide legal integer types.
5target datalayout = "n8:16:32:64"
6
7declare i1 @pred()
8
9define void @test(i32* %P) {
10; <label>:0
11 br label %Loop
12Loop: ; preds = %Loop, %0
13 %i = phi i32 [ 0, %0 ], [ %i.next, %Loop ]
14 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2]
15 %STRRED = getelementptr i32, i32* %P, i32 %INDVAR ; <i32*> [#uses=1]
16 store i32 0, i32* %STRRED
17 %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1]
18 %i.next = add i32 %i, 1
19 %cond = call i1 @pred( ) ; <i1> [#uses=1]
20 br i1 %cond, label %Loop, label %Out
21Out: ; preds = %Loop
22 ret void
23}
24