1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-02 00:42:52 +01:00
llvm-mirror/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll
2009-06-20 00:40:56 +00:00

19 lines
456 B
LLVM

; RUN: llvm-as < %s | opt -analyze -iv-users -disable-output | grep {Stride i64 {3,+,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.next, %indvar.next
ret i64 %r
}