[llvm] [RISCV][TTI] Adjust VLS shuffle costing to account for sub-mask reuse (PR #129793)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 19 13:43:59 PDT 2025
================
@@ -430,11 +430,14 @@ costShuffleViaVRegSplitting(RISCVTTIImpl &TTI, MVT LegalVT,
copy(Mask, NormalizedMask.begin());
InstructionCost Cost = 0;
int NumShuffles = 0;
+ DenseSet<std::pair<ArrayRef<int>, unsigned>> ReusedSingleSrcShuffles;
processShuffleMasks(
NormalizedMask, NumOfSrcRegs, NumOfDestRegs, NumOfDestRegs, []() {},
[&](ArrayRef<int> RegMask, unsigned SrcReg, unsigned DestReg) {
if (ShuffleVectorInst::isIdentityMask(RegMask, RegMask.size()))
return;
+ if (!ReusedSingleSrcShuffles.insert(std::make_pair(RegMask, SrcReg)).second)
----------------
preames wrote:
Neither DenseMap or SmallDenseMap have a method try_emplace
https://github.com/llvm/llvm-project/pull/129793
More information about the llvm-commits
mailing list