[llvm] [LV] Add support for widening loads/stores to a VF multiple (PR #217670)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 02:38:58 PDT 2026


================
@@ -3811,6 +3817,12 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPIRMetadata {
   InstructionCost computeCost(ElementCount VF, VPCostContext &Ctx) const;
 
   Instruction &getIngredient() const { return Ingredient; }
+
+  /// Set the VF multiple for this memory operation.
+  void setVFMultiple(unsigned VFMultiple) { this->VFMultiple = VFMultiple; }
+
+  /// Returns the VF multiple of this memory operation.
+  unsigned getVFMultiple() const { return VFMultiple; }
----------------
lukel97 wrote:

Adding a field to VPWidenMemoryRecipe that's only used for unrolling seems a bit unfortunate. It would be nice to keep the invariant that a VPWidenRecipe always generates VFxUF lanes. I'm not sure if anywhere else in the LV that checks `isa<VPWidenMemoryRecipe>` would need to be updated to check `getVFMultiple`.

Did you consider a VPInstruction instead, something like `VPInstruction::VFMultipleLoad/Store`?

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


More information about the llvm-commits mailing list