[llvm] 4d235bf - [tests] Add a couple tests for intersection of ec8d87e and D108651
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 24 14:29:41 PDT 2021
Author: Philip Reames
Date: 2021-08-24T14:29:36-07:00
New Revision: 4d235bf75d04b9727395af9efed74118227dbc10
URL: https://github.com/llvm/llvm-project/commit/4d235bf75d04b9727395af9efed74118227dbc10
DIFF: https://github.com/llvm/llvm-project/commit/4d235bf75d04b9727395af9efed74118227dbc10.diff
LOG: [tests] Add a couple tests for intersection of ec8d87e and D108651
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll b/llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll
index 78655485af9a..ce2136b50aa4 100644
--- a/llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll
+++ b/llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll
@@ -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
@@ -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
More information about the llvm-commits
mailing list