Skip to content

Commit 9d0ac39

Browse files
committed
[ARM] Use CostKind in getShuffleCost getMVEVectorCostFactor.
These calls pre-date CostKind being added to getShuffleCost in 5263155.
1 parent d3b339e commit 9d0ac39

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,8 +1330,7 @@ InstructionCost ARMTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
13301330
std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(SrcTy);
13311331
if (const auto *Entry = CostTableLookup(MVEDupTbl, ISD::VECTOR_SHUFFLE,
13321332
LT.second))
1333-
return LT.first * Entry->Cost *
1334-
ST->getMVEVectorCostFactor(TTI::TCK_RecipThroughput);
1333+
return LT.first * Entry->Cost * ST->getMVEVectorCostFactor(CostKind);
13351334
}
13361335

13371336
if (!Mask.empty()) {
@@ -1340,15 +1339,15 @@ InstructionCost ARMTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
13401339
Mask.size() <= LT.second.getVectorNumElements() &&
13411340
(isVREVMask(Mask, LT.second, 16) || isVREVMask(Mask, LT.second, 32) ||
13421341
isVREVMask(Mask, LT.second, 64)))
1343-
return ST->getMVEVectorCostFactor(TTI::TCK_RecipThroughput) * LT.first;
1342+
return ST->getMVEVectorCostFactor(CostKind) * LT.first;
13441343
}
13451344
}
13461345

13471346
// Restore optimal kind.
13481347
if (IsExtractSubvector)
13491348
Kind = TTI::SK_ExtractSubvector;
13501349
int BaseCost = ST->hasMVEIntegerOps() && SrcTy->isVectorTy()
1351-
? ST->getMVEVectorCostFactor(TTI::TCK_RecipThroughput)
1350+
? ST->getMVEVectorCostFactor(CostKind)
13521351
: 1;
13531352
return BaseCost * BaseT::getShuffleCost(Kind, DstTy, SrcTy, Mask, CostKind,
13541353
Index, SubTp);

0 commit comments

Comments
 (0)