[llvm] [LV] Convert gather loads with constant stride into strided loads (PR #147297)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 13 01:03:10 PST 2026


================
@@ -2955,6 +2955,20 @@ static VPRecipeBase *optimizeMaskToEVL(VPValue *HeaderMask,
         TypeInfo.inferScalarType(LoadR), {}, {}, DL);
   }
 
+  VPValue *Stride;
+  if (match(&CurRecipe, m_Intrinsic<Intrinsic::experimental_vp_strided_load>(
+                            m_VPValue(Addr), m_VPValue(Stride),
+                            m_RemoveMask(HeaderMask, Mask),
----------------
Mel-Chen wrote:

Hmm, it shouldn’t be an issue right now, since the only caller, `VPlanTransforms::optimizeEVLMasks`, has
```
if (!HeaderMask)
  return;
```
which prevents `HeaderMask` from being nullptr.

But, if possible, would it be better to pass `HeaderMask` by reference here? What do you think?

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


More information about the llvm-commits mailing list