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 | 2199dbc5ff22bb2b6fbccbdafd48767efa3ee901 (patch) | |
tree | 3df5262cdaccaa45baf17ffdce7ce9a442ce60c4 /llvm/test/Transforms/LoopStrengthReduce | |
parent | ff967be708a32e5ca14a32e4d19ada101eded768 (diff) | |
download | bcm5719-llvm-2199dbc5ff22bb2b6fbccbdafd48767efa3ee901.tar.gz bcm5719-llvm-2199dbc5ff22bb2b6fbccbdafd48767efa3ee901.zip |
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.
llvm-svn: 73774
Diffstat (limited to 'llvm/test/Transforms/LoopStrengthReduce')
-rw-r--r-- | llvm/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll b/llvm/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll new file mode 100644 index 00000000000..d15c2dc3135 --- /dev/null +++ b/llvm/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 +} |