blob: 83aeaa6a9c6c8a62db8e12a22e0d059f8d161e08 [file] [log] [blame]
Chris Lattner08c7fd12005-08-10 00:48:11 +00001; Check that variable strides are reduced to adds instead of multiplies.
Reid Spencerd0e30dc2006-12-02 04:23:10 +00002; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'mul'
Chris Lattner08c7fd12005-08-10 00:48:11 +00003
4declare bool %pred(int)
5
6void %test([10000 x int]* %P, int %STRIDE) {
7 br label %Loop
8Loop:
9 %INDVAR = phi int [0, %0], [%INDVAR2, %Loop]
10 %Idx = mul int %INDVAR, %STRIDE
11
12 %cond = call bool %pred(int %Idx)
13 %INDVAR2 = add int %INDVAR, 1
14 br bool %cond, label %Loop, label %Out
15Out:
16 ret void
17}