1*cee313d2SEric Christopher; Check that variable strides are reduced to adds instead of multiplies.
2*cee313d2SEric Christopher; RUN: opt < %s -loop-reduce -S | not grep mul
3*cee313d2SEric Christopher
4*cee313d2SEric Christopher; Provide legal integer types.
5*cee313d2SEric Christophertarget datalayout = "n8:16:32:64"
6*cee313d2SEric Christopher
7*cee313d2SEric Christopherdeclare i1 @pred(i32)
8*cee313d2SEric Christopher
9*cee313d2SEric Christopherdefine void @test([10000 x i32]* %P, i32 %STRIDE) {
10*cee313d2SEric Christopher; <label>:0
11*cee313d2SEric Christopher	br label %Loop
12*cee313d2SEric ChristopherLoop:		; preds = %Loop, %0
13*cee313d2SEric Christopher	%INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ]		; <i32> [#uses=2]
14*cee313d2SEric Christopher	%Idx = mul i32 %INDVAR, %STRIDE		; <i32> [#uses=1]
15*cee313d2SEric Christopher	%cond = call i1 @pred( i32 %Idx )		; <i1> [#uses=1]
16*cee313d2SEric Christopher	%INDVAR2 = add i32 %INDVAR, 1		; <i32> [#uses=1]
17*cee313d2SEric Christopher	br i1 %cond, label %Loop, label %Out
18*cee313d2SEric ChristopherOut:		; preds = %Loop
19*cee313d2SEric Christopher	ret void
20*cee313d2SEric Christopher}
21*cee313d2SEric Christopher
22