[llvm] [VPlan] Compute cost for binary op VPInstruction with underlying values. (PR #125434)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 13:53:25 PST 2025


================
@@ -768,6 +768,27 @@ void VPInstruction::execute(VPTransformState &State) {
             /*IsScalar*/ GeneratesPerFirstLaneOnly);
 }
 
+InstructionCost VPInstruction::computeCost(ElementCount VF,
+                                           VPCostContext &Ctx) const {
+  if (Instruction::isBinaryOp(getOpcode())) {
+    if (!getUnderlyingValue())
----------------
fhahn wrote:

Yep, added a TODO,thanks!

 I don't think it can be an assert, as there are cases where we create binary ops without underlying instructions in some cases.



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


More information about the llvm-commits mailing list