[llvm] [RISCV] Fix missing scaling by LMUL in cost model (PR #73342)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 28 21:29:10 PST 2023
================
@@ -1117,30 +1118,30 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
if (ST->hasVInstructions() && LT.second.isVector()) {
// vrsub.vi v10, v8, 0
// vmax.vv v8, v8, v10
- return LT.first * 2;
+ return LT.first * TLI->getLMULCost(LT.second) * 2;
}
break;
}
// TODO: add more intrinsic
case Intrinsic::experimental_stepvector: {
unsigned Cost = 1; // vid
auto LT = getTypeLegalizationCost(RetTy);
- return Cost + (LT.first - 1);
+ return Cost + (LT.first - 1) * TLI->getLMULCost(LT.second);
----------------
topperc wrote:
I think this should be `(Cost + (LT.first - 1)) * TLI->getLMULCost(LT.second);`
https://github.com/llvm/llvm-project/pull/73342
More information about the llvm-commits
mailing list