[llvm] [VPlan] Introduce recipes for VP loads and stores. (PR #87816)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 15:24:50 PDT 2024


================
@@ -2390,13 +2387,48 @@ struct VPWidenLoadRecipe final : public VPWidenMemoryRecipe, public VPValue {
   bool onlyFirstLaneUsed(const VPValue *Op) const override {
     assert(is_contained(operands(), Op) &&
            "Op must be an operand of the recipe");
-
     // Widened, consecutive loads operations only demand the first lane of
     // their address.
     return Op == getAddr() && isConsecutive();
   }
 };
 
+/// A recipe for widening load operations with vector-predication intrinsics,
+/// using the address to load from, the explicit vector length and an optional
+/// mask.
+struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue {
+  VPWidenLoadEVLRecipe(VPWidenLoadRecipe *L, VPValue *EVL, VPValue *Mask)
+      : VPWidenMemoryRecipe(
+            VPDef::VPWidenLoadEVLSC, *cast<LoadInst>(&L->getIngredient()),
----------------
ayalz wrote:

```suggestion
            VPDef::VPWidenLoadEVLSC, L->getIngredient(),
```
Still a redundant cast?

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


More information about the llvm-commits mailing list