[llvm] [VPlan] Introduces explicit broadcast for live-in constants. (PR #133213)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 23 09:01:14 PDT 2025


================
@@ -1533,6 +1544,14 @@ class VPWidenCallRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
   void print(raw_ostream &O, const Twine &Indent,
              VPSlotTracker &SlotTracker) const override;
 #endif
+
+  /// Returns true if the recipe only uses the first lane of operand \p Op.
+  bool onlyFirstLaneUsed(const VPValue *Op) const override {
+    assert(is_contained(operands(), Op) &&
+           "Op must be an operand of the recipe");
+    // Scalar called fuction cannot be vectorized.
+    return Op == getOperand(getNumOperands() - 1);
----------------
david-arm wrote:

If I understand correctly, the last operand is the called scalar function, right?

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


More information about the llvm-commits mailing list