Skip to content

Commit 273dea4

Browse files
davemgreenmemfrob
authored andcommitted
[ARM] Change getScalarizationOverhead overload used in gather costs. NFC
This changes which of the getScalarizationOverhead overloads is used in the gather/scatter cost to use the base variant directly, not relying on the version using heuristics on the number of args with no args provided. It should still produce the same costs for scalarized gathers/scatters.
1 parent 2d2e66e commit 273dea4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,8 +1416,9 @@ unsigned ARMTTIImpl::getGatherScatterOpCost(unsigned Opcode, Type *DataTy,
14161416
unsigned VectorCost = NumElems * LT.first * ST->getMVEVectorCostFactor();
14171417
// The scalarization cost should be a lot higher. We use the number of vector
14181418
// elements plus the scalarization overhead.
1419-
unsigned ScalarCost =
1420-
NumElems * LT.first + BaseT::getScalarizationOverhead(VTy, {});
1419+
unsigned ScalarCost = NumElems * LT.first +
1420+
BaseT::getScalarizationOverhead(VTy, true, false) +
1421+
BaseT::getScalarizationOverhead(VTy, false, true);
14211422

14221423
if (EltSize < 8 || Alignment < EltSize / 8)
14231424
return ScalarCost;

0 commit comments

Comments
 (0)