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

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 11 02:01:17 PST 2025


================
@@ -3350,6 +3376,57 @@ struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue {
   }
 };
 
+/// A recipe for strided load operations, using the base address, stride, VF,
+/// and an optional mask. This recipe will generate a vp.strided.load intrinsic
+/// call to represent memory accesses with a fixed stride.
+struct VPWidenStridedLoadRecipe final : public VPWidenMemoryRecipe,
----------------
lukel97 wrote:

> My thinking here is different. I believe it is better to start with a high-level semantic recipe and gradually lower it into more concrete recipes, similar to what convertToConcreteRecipes does, rather than basing it solely on the number of targets that can support it.

I think its fine to have VPWidenStridedLoadRecipe as a high level recipe, I'm not suggesting to remove it necessarily. I just think it shouldn't emit vp.strided.load, since every other target that's not RISC-V will have to "legalize" it. 

We should convert it to a VP intrinsic as a separate step that's only run on RISC-V

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


More information about the llvm-commits mailing list