[llvm] [VPlan] Expand WidenInt inductions with nuw/nsw (PR #163538)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 15 22:51:00 PDT 2025


================
@@ -26,7 +26,7 @@ define void @test_wide_integer_induction(ptr noalias %a, i64 %N) {
 ; CHECK-NEXT:    call void @llvm.vp.store.nxv2i64.p0(<vscale x 2 x i64> [[VEC_IND]], ptr align 8 [[TMP14]], <vscale x 2 x i1> splat (i1 true), i32 [[TMP11]])
 ; CHECK-NEXT:    [[INDEX_EVL_NEXT]] = add i64 [[TMP12]], [[EVL_BASED_IV]]
 ; CHECK-NEXT:    [[AVL_NEXT]] = sub nuw i64 [[AVL]], [[TMP12]]
-; CHECK-NEXT:    [[VEC_IND_NEXT]] = add <vscale x 2 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
+; CHECK-NEXT:    [[VEC_IND_NEXT]] = add nuw nsw <vscale x 2 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
----------------
lukel97 wrote:

For tail folded loops do we need to drop the nuw/nsw flags? I remember a couple of weeks ago you had a PR where you were addressing something similar?
Since the range of the vector indices may extend further than the original scalar indices when tail folded. 

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


More information about the llvm-commits mailing list