[llvm-commits] CVS: llvm/test/Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll
Chris Lattner
lattner at cs.uiuc.edu
Sun Mar 6 14:23:46 PST 2005
Changes in directory llvm/test/Regression/Transforms/LoopStrengthReduce:
dont_insert_redundant_ops.ll added (r1.1)
---
Log message:
check that we only insert one phi node per loop
---
Diffs of the changes: (+42 -0)
dont_insert_redundant_ops.ll | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+)
Index: llvm/test/Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll
diff -c /dev/null llvm/test/Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll:1.1
*** /dev/null Sun Mar 6 16:23:41 2005
--- llvm/test/Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll Sun Mar 6 16:23:31 2005
***************
*** 0 ****
--- 1,42 ----
+ ; Check that this test makes INDVAR and related stuff dead.
+ ; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | wc -l | grep 2
+
+ declare bool %pred()
+
+ void %test({ int, int }* %P) {
+ br label %Loop
+ Loop:
+ %INDVAR = phi int [0, %0], [%INDVAR2, %Loop]
+
+ %gep1 = getelementptr { int, int}* %P, int %INDVAR, uint 0
+ store int 0, int* %gep1
+
+ %gep2 = getelementptr { int, int}* %P, int %INDVAR, uint 1
+ store int 0, int* %gep2
+
+ %INDVAR2 = add int %INDVAR, 1
+ %cond = call bool %pred()
+ br bool %cond, label %Loop, label %Out
+ Out:
+ ret void
+ }
+
+ declare bool %pred()
+
+ void %test([2 x int]* %P) {
+ br label %Loop
+ Loop:
+ %INDVAR = phi int [0, %0], [%INDVAR2, %Loop]
+
+ %gep1 = getelementptr [2 x int]* %P, int %INDVAR, uint 0
+ store int 0, int* %gep1
+
+ %gep2 = getelementptr [2 x int]* %P, int %INDVAR, uint 1
+ store int 0, int* %gep2
+
+ %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