llvm-6502/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll
Dan Gohman 8dae138d06 Fix WriteAsOperand to not emit a leading space character. Adjust
its callers to emit a space character before calling it when a
space is needed.

This fixes several spurious whitespace issues in
ScalarEvolution's debug dumps. See the test changes for
examples.

This also fixes odd space-after-tab indentation in the output
for switch statements, and changes calls from being printed like
this:
  call void @foo( i32 %x )
to this:
  call void @foo(i32 %x)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56196 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-14 17:21:12 +00:00

28 lines
783 B
LLVM

; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \
; RUN: -scalar-evolution-max-iterations=0 | \
; RUN: grep -F "(-1 + (-1 * %j)) iterations"
; 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
}