[llvm] 5c57600 - [tests] Precommit test for D104140

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 16 10:58:06 PDT 2021


Author: Philip Reames
Date: 2021-07-16T10:57:59-07:00
New Revision: 5c57600b934ac9b64cd557b90560de7d9df66a1d

URL: https://github.com/llvm/llvm-project/commit/5c57600b934ac9b64cd557b90560de7d9df66a1d
DIFF: https://github.com/llvm/llvm-project/commit/5c57600b934ac9b64cd557b90560de7d9df66a1d.diff

LOG: [tests] Precommit test for D104140

Added: 
    

Modified: 
    llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll b/llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll
index a013978c84a3..adc6dcc3fa12 100644
--- a/llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll
+++ b/llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll
@@ -84,6 +84,25 @@ for.end:                                          ; preds = %for.body, %entry
   ret void
 }
 
+; CHECK-LABEL: Determining loop execution counts for: @ult_129_unknown_start
+; CHECK: Loop %for.body: Unpredictable backedge-taken count
+; CHECK: Loop %for.body: Unpredictable max backedge-taken count
+
+define void @ult_129_unknown_start(i8 %start) mustprogress {
+entry:
+  br label %for.body
+
+for.body:                                         ; preds = %entry, %for.body
+  %i.05 = phi i8 [ %add, %for.body ], [ %start, %entry ]
+  %add = add nuw i8 %i.05, 129
+  %cmp = icmp ult i8 %add, 128
+  br i1 %cmp, label %for.body, label %for.end
+
+for.end:                                          ; preds = %for.body, %entry
+  ret void
+}
+
+
 ; A case with a non-constant stride where the backedge is not taken
 ; CHECK-LABEL: Determining loop execution counts for: @ult_not_taken
 ; CHECK: Loop %for.body: Unpredictable backedge-taken count
@@ -288,6 +307,23 @@ for.end:                                          ; preds = %for.body, %entry
   ret void
 }
 
+; CHECK-LABEL: Determining loop execution counts for: @slt_129_unknown_start
+; CHECK: Loop %for.body: Unpredictable backedge-taken count
+; CHECK: Loop %for.body: Unpredictable max backedge-taken count
+
+define void @slt_129_unknown_start(i8 %start) mustprogress {
+entry:
+  br label %for.body
+
+for.body:                                         ; preds = %entry, %for.body
+  %i.05 = phi i8 [ %add, %for.body ], [ %start, %entry ]
+  %add = add nsw i8 %i.05, 129
+  %cmp = icmp slt i8 %add, 0
+  br i1 %cmp, label %for.body, label %for.end
+
+for.end:                                          ; preds = %for.body, %entry
+  ret void
+}
 
 
 ; IV does wrap, and thus causes us to branch on poison.  This loop is


        


More information about the llvm-commits mailing list