diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-10 00:48:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-10 00:48:11 +0000 |
commit | 138268160adf9bd1c31a213ec74d1b3effb10856 (patch) | |
tree | a2a66f18c6618f95cb91ec122c3d71306211c201 /test/Transforms | |
parent | 50fad70279fa982fcd6a72c919f4e18ad99829b9 (diff) | |
download | external_llvm-138268160adf9bd1c31a213ec74d1b3effb10856.zip external_llvm-138268160adf9bd1c31a213ec74d1b3effb10856.tar.gz external_llvm-138268160adf9bd1c31a213ec74d1b3effb10856.tar.bz2 |
new testcase we handle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/LoopStrengthReduce/variable_stride.ll | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/LoopStrengthReduce/variable_stride.ll b/test/Transforms/LoopStrengthReduce/variable_stride.ll new file mode 100644 index 0000000..25103bf --- /dev/null +++ b/test/Transforms/LoopStrengthReduce/variable_stride.ll @@ -0,0 +1,17 @@ +; Check that variable strides are reduced to adds instead of multiplies. +; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep 'mul' + +declare bool %pred(int) + +void %test([10000 x int]* %P, int %STRIDE) { + br label %Loop +Loop: + %INDVAR = phi int [0, %0], [%INDVAR2, %Loop] + %Idx = mul int %INDVAR, %STRIDE + + %cond = call bool %pred(int %Idx) + %INDVAR2 = add int %INDVAR, 1 + br bool %cond, label %Loop, label %Out +Out: + ret void +} |