[llvm-commits] CVS: llvm/test/Regression/Transforms/LoopStrengthReduce/ops_after_indvar.ll
Chris Lattner
lattner at cs.uiuc.edu
Sun Mar 6 14:01:58 PST 2005
Changes in directory llvm/test/Regression/Transforms/LoopStrengthReduce:
ops_after_indvar.ll added (r1.1)
---
Log message:
Add test for this:
Allow operands after the induction variable (no restrictions):
int x;
for (i)
j = .....
a[i][x][j]
---
Diffs of the changes: (+22 -0)
ops_after_indvar.ll | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+)
Index: llvm/test/Regression/Transforms/LoopStrengthReduce/ops_after_indvar.ll
diff -c /dev/null llvm/test/Regression/Transforms/LoopStrengthReduce/ops_after_indvar.ll:1.1
*** /dev/null Sun Mar 6 16:01:52 2005
--- llvm/test/Regression/Transforms/LoopStrengthReduce/ops_after_indvar.ll Sun Mar 6 16:01:42 2005
***************
*** 0 ****
--- 1,22 ----
+ ; Check that this test makes INDVAR and related stuff dead, because P[indvar]
+ ; gets reduced, making INDVAR dead.
+
+ ; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep INDVAR
+
+ declare bool %pred()
+ declare int %getidx()
+
+ void %test([10000 x int]* %P) {
+ br label %Loop
+ Loop:
+ %INDVAR = phi int [0, %0], [%INDVAR2, %Loop]
+ %idx = call int %getidx()
+ %STRRED = getelementptr [10000 x int]* %P, int %INDVAR, int %idx
+ store int 0, int* %STRRED
+
+ %INDVAR2 = add int %INDVAR, 1
+ %cond = call bool %pred()
+ br bool %cond, label %Loop, label %Out
+ Out:
+ ret void
+ }
More information about the llvm-commits
mailing list