mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 02:33:33 +00:00
572645cf84
bug fixes, and with improved heuristics for analyzing foreign-loop addrecs. This change also flattens IVUsers, eliminating the stride-oriented groupings, which makes it easier to work with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95975 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
436 B
LLVM
19 lines
436 B
LLVM
; RUN: opt < %s -analyze -iv-users | grep {\{1,+,3,+,2\}<%loop> (post-inc)}
|
|
|
|
; 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
|
|
}
|