Skip to content

Commit

Permalink
[tests] Add a couple tests for intersection of ec8d87e and D108651
Browse files Browse the repository at this point in the history
  • Loading branch information
preames committed Aug 24, 2021
1 parent 1c829ce commit 4d235bf
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll
Expand Up @@ -27,6 +27,24 @@ for.end: ; preds = %for.body, %entry
ret void
}

; CHECK-LABEL: Determining loop execution counts for: @neg_nw_nuw
; CHECK: Loop %for.body: Unpredictable backedge-taken count
; CHECK: Loop %for.body: Unpredictable max backedge-taken count
define void @neg_nw_nuw(i16 %n) mustprogress {
entry:
br label %for.body

for.body: ; preds = %entry, %for.body
%iv = phi i8 [ %iv.next, %for.body ], [ 0, %entry ]
%iv.next = add i8 %iv, -1
%zext = zext i8 %iv to i16
%cmp = icmp ult i16 %zext, %n
br i1 %cmp, label %for.body, label %for.end

for.end: ; preds = %for.body, %entry
ret void
}

; CHECK-LABEL: Determining loop execution counts for: @nw_implies_nsw
; CHECK: Loop %for.body: Unpredictable backedge-taken count
; CHECK: Loop %for.body: Unpredictable max backedge-taken count
Expand All @@ -45,6 +63,24 @@ for.end: ; preds = %for.body, %entry
ret void
}

; CHECK-LABEL: Determining loop execution counts for: @neg_nw_nsw
; CHECK: Loop %for.body: Unpredictable backedge-taken count
; CHECK: Loop %for.body: Unpredictable max backedge-taken count
define void @neg_nw_nsw(i16 %n) mustprogress {
entry:
br label %for.body

for.body: ; preds = %entry, %for.body
%iv = phi i8 [ %iv.next, %for.body ], [ -128, %entry ]
%iv.next = add i8 %iv, -1
%zext = sext i8 %iv to i16
%cmp = icmp slt i16 %zext, %n
br i1 %cmp, label %for.body, label %for.end

for.end: ; preds = %for.body, %entry
ret void
}


; CHECK-LABEL: Determining loop execution counts for: @actually_infinite
; CHECK: Loop %for.body: Unpredictable backedge-taken count
Expand Down

0 comments on commit 4d235bf

Please sign in to comment.