2010-01-27 03:25:59 +08:00
|
|
|
; RUN: opt < %s -analyze -scalar-evolution \
|
2009-10-27 22:54:46 +08:00
|
|
|
; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s
|
2008-07-30 08:04:08 +08:00
|
|
|
; 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
|
|
|
|
}
|
|
|
|
|
2009-10-27 22:54:46 +08:00
|
|
|
; CHECK: backedge-taken count is (-1 + (-1 * %j))
|
|
|
|
|