[llvm] [VPlan] Handle single-scalar conds in VPWidenSelectRecipe. (PR #165506)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 29 17:27:21 PDT 2025


================
@@ -2022,6 +2023,11 @@ InstructionCost VPWidenSelectRecipe::computeCost(ElementCount VF,
       {TTI::OK_AnyValue, TTI::OP_None}, {TTI::OK_AnyValue, TTI::OP_None}, SI);
 }
 
+bool VPWidenSelectRecipe::onlyFirstLaneUsed(const VPValue *Op) const {
+  assert(is_contained(operands(), Op) && "Op must be an operand of the recipe");
+  return Op == getCond() && vputils::isSingleScalar(getCond());
----------------
fhahn wrote:

Yes, but also needed to determine if we need to broadcast or not at the moment, for which we need to provide this at the uses as well, I think?

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


More information about the llvm-commits mailing list