[llvm] [RISCV][CostModel] Updates reduction and shuffle cost (PR #77342)
Shih-Po Hung via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 18:14:14 PST 2024
================
@@ -528,12 +526,19 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
// vrsub.vx v10, v9, a0
// vrgather.vv v9, v8, v10
InstructionCost LenCost = 3;
- if (LT.second.isFixedLengthVector())
+ InstructionCost GatherCost;
+ if (LT.second.isFixedLengthVector()) {
// vrsub.vi has a 5 bit immediate field, otherwise an li suffices
LenCost = isInt<5>(LT.second.getVectorNumElements() - 1) ? 0 : 1;
- // FIXME: replace the constant `2` below with cost of {VID_V,VRSUB_VX}
- InstructionCost GatherCost =
- 2 + getRISCVInstructionCost(RISCV::VRGATHER_VV, LT.second, CostKind);
+ GatherCost = getRISCVInstructionCost(
----------------
arcbbb wrote:
Fixed
https://github.com/llvm/llvm-project/pull/77342
More information about the llvm-commits
mailing list