[llvm] [VPlan] Use wide IV if scalar lanes > 0 are used with scalable vectors. (PR #169796)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 1 08:16:58 PST 2025


================
@@ -15,25 +15,22 @@ define void @test_invar_gep(ptr %dst) #0 {
 ; CHECK-NEXT:    [[TMP3:%.*]] = mul nuw i64 [[TMP2]], 4
 ; CHECK-NEXT:    [[N_MOD_VF:%.*]] = urem i64 100, [[TMP3]]
 ; CHECK-NEXT:    [[N_VEC:%.*]] = sub i64 100, [[N_MOD_VF]]
+; CHECK-NEXT:    [[TMP5:%.*]] = call <vscale x 4 x i64> @llvm.stepvector.nxv4i64()
+; CHECK-NEXT:    [[TMP4:%.*]] = mul nsw <vscale x 4 x i64> [[TMP5]], splat (i64 1)
----------------
lukel97 wrote:

I think all the loops in this test will get folded away by LICM. Were we seeing something in the wild where we needed to generate the last lane of an induction variable with a scalable VF?

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


More information about the llvm-commits mailing list