1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll
Dan Gohman dd9c79d45b Rename ScalarEvolution's getIterationCount to getBackedgeTakenCount,
to more accurately describe what it does. Expand its doxygen comment
to describe what the backedge-taken count is and how it differs
from the actual iteration count of the loop. Adjust names and
comments in associated code accordingly.

llvm-svn: 65382
2009-02-24 18:55:53 +00:00

28 lines
796 B
LLVM

; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \
; RUN: -scalar-evolution-max-iterations=0 | \
; RUN: grep -F "backedge-taken count is (-1 + (-1 * %j))"
; PR2607
define i32 @_Z1aj(i32 %j) nounwind {
entry:
icmp sgt i32 0, %j ; <i1>:0 [#uses=1]
br i1 %0, label %bb.preheader, label %return
bb.preheader: ; preds = %entry
br label %bb
bb: ; preds = %bb, %bb.preheader
%i.01 = phi i32 [ %1, %bb ], [ 0, %bb.preheader ] ; <i32> [#uses=1]
add i32 %i.01, -1 ; <i32>:1 [#uses=3]
icmp sgt i32 %1, %j ; <i1>:2 [#uses=1]
br i1 %2, label %bb, label %return.loopexit
return.loopexit: ; preds = %bb
br label %return
return: ; preds = %return.loopexit, %entry
%i.0.lcssa = phi i32 [ 0, %entry ], [ %1, %return.loopexit ] ; <i32> [#uses=1]
ret i32 %i.0.lcssa
}