[llvm] [VPlan] Add VPValue for VF, use it for VPWidenIntOrFpInductionRecipe. (PR #95305)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 25 05:34:10 PDT 2024
================
@@ -385,8 +381,8 @@ define void @test_reversed_load2_store2(ptr noalias nocapture readonly %A, ptr n
; CHECK-NEXT: [[TMP1:%.*]] = shl nuw nsw i64 [[TMP0]], 2
; CHECK-NEXT: [[TMP2:%.*]] = call <vscale x 4 x i32> @llvm.experimental.stepvector.nxv4i32()
; CHECK-NEXT: [[INDUCTION:%.*]] = sub <vscale x 4 x i32> shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 1023, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer), [[TMP2]]
-; CHECK-NEXT: [[TMP3:%.*]] = call i32 @llvm.vscale.i32()
-; CHECK-NEXT: [[DOTNEG:%.*]] = mul nsw i32 [[TMP3]], -4
+; CHECK-NEXT: [[TMP3:%.*]] = trunc nuw nsw i64 [[TMP1]] to i32
----------------
david-arm wrote:
In practice it probably doesn't matter since vscale is not unlikely to ever be that large, but the code after is not the same as before. Suppose vscale = 0xFFFFFFFF, then previously we'd be doing
0xFFFFFFFF (-1) * -4 -> +4
whereas now it would be
0xFFFFFFFF << 2 -> 0x3FFFFFFFC
trunc(0x3FFFFFFFC) to i32 -> 0xFFFFFFFC
0 - 0xFFFFFFFC -> poison due to nsw?
Perhaps the previous code was simply incorrect?
https://github.com/llvm/llvm-project/pull/95305
More information about the llvm-commits
mailing list