[llvm] [VPlan] Strip op-UV-check in select-costing (PR #207438)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 02:49:09 PDT 2026


================
@@ -1283,8 +1283,7 @@ InstructionCost VPRecipeWithIRFlags::getCostForRecipeWithOpcode(
       const auto [Op2VK, Op2VP] = Ctx.getOperandInfo(Op1);
 
       SmallVector<const Value *, 2> Operands;
-      if (SI && all_of(operands(),
-                       [](VPValue *Op) { return Op->getUnderlyingValue(); }))
----------------
fhahn wrote:

IIRC the intention behind this was to only pass the any operands if we have IR values for all operands.  Consider the case where we simplify one of the operands to a VPValue without underlying value. The passed operands would be misleading.

The current check as-is can still lead to misleading results (e.g. if an operand is simplified to a differnet VPValue with underlying value). Ideally we would strengthen the check instead. This may be needed in other places as well

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


More information about the llvm-commits mailing list