[llvm] [LV][VPlan] Add initial support for CSA vectorization (PR #121222)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 09:55:54 PST 2025


================
@@ -2840,6 +2875,134 @@ class VPBranchOnMaskRecipe : public VPRecipeBase {
   }
 };
 
+class VPConditionalScalarAssignmentHeaderPHIRecipe final
+    : public VPHeaderPHIRecipe {
+public:
+  VPConditionalScalarAssignmentHeaderPHIRecipe(PHINode *Phi,
+                                               VPValue *VPInitData)
+      : VPHeaderPHIRecipe(VPDef::VPConditionalScalarAssignmentHeaderPHISC, Phi,
+                          VPInitData) {}
+
+  ~VPConditionalScalarAssignmentHeaderPHIRecipe() override = default;
+
+  VPConditionalScalarAssignmentHeaderPHIRecipe *clone() override {
+    return new VPConditionalScalarAssignmentHeaderPHIRecipe(
+        cast<PHINode>(getUnderlyingInstr()), getOperand(0));
+  }
+
+  void execute(VPTransformState &State) override;
+
+  InstructionCost computeCost(ElementCount VF,
+                              VPCostContext &Ctx) const override;
+
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+  /// Print the recipe.
+  void print(raw_ostream &O, const Twine &Indent,
+             VPSlotTracker &SlotTracker) const override;
+#endif
----------------
michaelmaitland wrote:

No other recipes in this file have dump functions.

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


More information about the llvm-commits mailing list