[llvm] [indvars] Prove non-negative for widening IVs in count down loops (PR #71214)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 11:08:09 PDT 2023


================
@@ -811,14 +806,14 @@ define void @sext_postinc_offset_constant_minus_one(ptr %A, i32 %start) {
 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[TMP0]], [[FOR_BODY_PREHEADER]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
-; CHECK-NEXT:    [[TMP1:%.*]] = trunc i64 [[INDVARS_IV]] to i32
-; CHECK-NEXT:    [[ADD_US:%.*]] = add i32 [[TMP1]], -1
+; CHECK-NEXT:    [[J_016_US:%.*]] = phi i32 [ [[INC_US:%.*]], [[FOR_BODY]] ], [ [[START]], [[FOR_BODY_PREHEADER]] ]
----------------
preames wrote:

This regression should be resolved by https://github.com/llvm/llvm-project/pull/70967.  I didn't make it a dependent review as all this one does is shift around where we have that problem.  As you can see in some of the test changes above, it sometimes removes the fallback and sometimes adds it.  

https://github.com/llvm/llvm-project/pull/71214


More information about the llvm-commits mailing list