1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll
Dan Gohman b5210c934f Generalize IVUsers to track arbitrary expressions rather than expressions
explicitly split into stride-and-offset pairs. Also, add the
ability to track multiple post-increment loops on the same expression.

This refines the concept of "normalizing" SCEV expressions used for
to post-increment uses, and introduces a dedicated utility routine for
normalizing and denormalizing expressions.

This fixes the expansion of expressions which are post-increment users
of more than one loop at a time. More broadly, this takes LSR another
step closer to being able to reason about more than one loop at a time.

llvm-svn: 100699
2010-04-07 22:27:08 +00:00

19 lines
452 B
LLVM

; RUN: opt < %s -analyze -iv-users | grep {\{1,+,3,+,2\}<%loop> (post-inc with loop %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.next, %indvar.next
ret i64 %r
}