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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 23 10:52:16 PDT 2025


================
@@ -1339,6 +1339,17 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
   void print(raw_ostream &O, const Twine &Indent,
              VPSlotTracker &SlotTracker) const override;
 #endif
+
+  bool onlyFirstLaneUsed(const VPValue *Op) const override {
+    assert(is_contained(operands(), Op) &&
+           "Op must be an operand of the recipe");
+    switch (Opcode) {
+    default:
+      return false;
+    case Instruction::ExtractValue:
+      return Op == getOperand(1);
----------------
fhahn wrote:

Simpler to check for the single opcode we are intersted in with an `if`?

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


More information about the llvm-commits mailing list