[llvm] [VPlan] Preserve WideIVStep wrap-flags (PR #191284)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 07:58:05 PDT 2026


================
@@ -6110,7 +6110,7 @@ define void @test_optimized_cast_induction_feeding_first_order_recurrence(i64 %n
 ; UNROLL-NO-IC-NEXT:    [[BROADCAST_SPLAT:%.*]] = shufflevector <2 x i32> [[BROADCAST_SPLATINSERT]], <2 x i32> poison, <2 x i32> zeroinitializer
 ; UNROLL-NO-IC-NEXT:    [[DOTCAST:%.*]] = trunc i64 [[N_VEC]] to i32
 ; UNROLL-NO-IC-NEXT:    [[IND_END:%.*]] = mul i32 [[DOTCAST]], [[STEP]]
-; UNROLL-NO-IC-NEXT:    [[TMP17:%.*]] = mul <2 x i32> splat (i32 2), [[BROADCAST_SPLAT]]
+; UNROLL-NO-IC-NEXT:    [[TMP17:%.*]] = mul nsw <2 x i32> splat (i32 2), [[BROADCAST_SPLAT]]
----------------
fhahn wrote:

The proof is for subtracts,  i can also be adjusted it for adds, e.g. if the step is negative at runtime 

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


More information about the llvm-commits mailing list