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

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 3 11:01:28 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Ramkumar Ramachandra (artagnon)

<details>
<summary>Changes</summary>

It does not make sense to check that the recipe's operands have underlying values when all we're using is the operands of its underlying instruction.

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


1 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp (+1-2) 


``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 24abcf7646066..71f7622cec843 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -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(); }))
+      if (SI)
         append_range(Operands, SI->operands());
       return Ctx.TTI.getArithmeticInstrCost(
           IsLogicalOr ? Instruction::Or : Instruction::And, ResultTy,

``````````

</details>


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


More information about the llvm-commits mailing list