[llvm] [TTI][RISCV]Improve costs for whole vector reg extract/insert. (PR #80164)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 11:26:56 PST 2024
================
@@ -326,6 +326,18 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
switch (Kind) {
default:
break;
+ case TTI::SK_InsertSubvector:
+ if (auto *FSubTy = dyn_cast<FixedVectorType>(SubTp)) {
+ unsigned TpRegs = getRegUsageForType(Tp);
+ unsigned SubTpRegs = getRegUsageForType(SubTp);
+ unsigned NextSubTpRegs = getRegUsageForType(FixedVectorType::get(
+ Tp->getElementType(), FSubTy->getNumElements() + 1));
+ // Whole vector insert - just the vector itself.
+ if (Index == 0 && SubTpRegs != 0 && SubTpRegs != NextSubTpRegs &&
+ TpRegs / SubTpRegs > 1)
----------------
alexey-bataev wrote:
Ok, will do
https://github.com/llvm/llvm-project/pull/80164
More information about the llvm-commits
mailing list