[llvm] [AArch64][CostModel] Improve cost estimate of scalarizing a vector di… (PR #118055)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 03:54:22 PST 2024


================
@@ -11561,9 +11561,9 @@ BoUpSLP::getEntryCost(const TreeEntry *E, ArrayRef<Value *> VectorizedVals,
       unsigned OpIdx = isa<UnaryOperator>(VL0) ? 0 : 1;
       TTI::OperandValueInfo Op1Info = getOperandInfo(E->getOperand(0));
       TTI::OperandValueInfo Op2Info = getOperandInfo(E->getOperand(OpIdx));
-      return TTI->getArithmeticInstrCost(ShuffleOrOp, VecTy, CostKind, Op1Info,
-                                         Op2Info, {}, nullptr, TLI) +
-             CommonCost;
+      return CommonCost +
+             TTI->getArithmeticInstrCost(ShuffleOrOp, VecTy, CostKind, Op1Info,
+                                         Op2Info, E->Scalars, nullptr, TLI);
----------------
alexey-bataev wrote:

This is incorrect, it should pass operands, not the original scalars

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


More information about the llvm-commits mailing list