[llvm] [LV] Implement usesFirstLaneOnly for VPWidenCallRecipe (PR #196562)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 03:23:09 PDT 2026


================
@@ -1883,6 +1883,18 @@ InstructionCost VPWidenCallRecipe::computeCost(ElementCount VF,
                                   Ctx.CostKind);
 }
 
+bool VPWidenCallRecipe::usesFirstLaneOnly(const VPValue *Op) const {
+  assert(is_contained(operands(), Op) && "Op must be an operand of the recipe");
+  assert(Variant && "Variant not set");
+  FunctionType *VFTy = Variant->getFunctionType();
+  return all_of(enumerate(args()), [VFTy, &Op](const auto &Arg) {
+    auto [Idx, V] = Arg;
+    Type *ArgTy = VFTy->getParamType(Idx);
+    return V != Op || ArgTy->isIntegerTy() || ArgTy->isFloatingPointTy() ||
+           ArgTy->isPointerTy() || ArgTy->isByteTy();
----------------
fhahn wrote:

With the fix landed, can we now go back to including Byte here?

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


More information about the llvm-commits mailing list