[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
Tue Nov 7 08:29:51 PST 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:

The change above landed.  I did realize we need one other change as well, to fully handle these cases: https://github.com/llvm/llvm-project/pull/71557

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


More information about the llvm-commits mailing list