diff options
author | Dan Gohman <gohman@apple.com> | 2009-06-19 17:33:15 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-06-19 17:33:15 +0000 |
commit | 2c1955c1f7d30c471b41b0c4ad175f26ff4b144f (patch) | |
tree | ef04fcff2b455457ee7e6dc32da5034ca155c88d /test/Transforms | |
parent | df6785b1c17af715a95145f6dbf70090a5997fdc (diff) | |
download | external_llvm-2c1955c1f7d30c471b41b0c4ad175f26ff4b144f.zip external_llvm-2c1955c1f7d30c471b41b0c4ad175f26ff4b144f.tar.gz external_llvm-2c1955c1f7d30c471b41b0c4ad175f26ff4b144f.tar.bz2 |
Don't (unconditionally) use getSCEVAtScope to simplify the step
expression in IVUsers, because in the case of a use of a non-linear
addrec outside of a loop, this causes the addrec to be evaluated as
a linear addrec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll b/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll new file mode 100644 index 0000000..d15c2dc --- /dev/null +++ b/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | opt -analyze -iv-users -disable-output | grep {Stride i64 {1,+,2}<loop>:} + +; The value of %r is dependent on a polynomial iteration expression. + +define i64 @foo(i64 %n) { +entry: + br label %loop + +loop: + %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %loop ] + %indvar.next = add i64 %indvar, 1 + %c = icmp eq i64 %indvar.next, %n + br i1 %c, label %exit, label %loop + +exit: + %r = mul i64 %indvar, %indvar + ret i64 %r +} |