Skip to content

Commit 3c3e0e5

Browse files
committed
[TTI] getCommonMaskedMemoryOpCost - add AddressSpace argument
Still defaults to AddressSpace = 0, but will allow us to hook up getMaskedMemoryOpCost calls once we have test coverage.
1 parent 5419623 commit 3c3e0e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
209209
Align Alignment,
210210
bool VariableMask,
211211
bool IsGatherScatter,
212-
TTI::TargetCostKind CostKind) {
212+
TTI::TargetCostKind CostKind,
213+
unsigned AddressSpace = 0) {
213214
// We cannot scalarize scalable vectors, so return Invalid.
214215
if (isa<ScalableVectorType>(DataTy))
215216
return InstructionCost::getInvalid();
@@ -230,8 +231,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
230231
CostKind, -1, nullptr, nullptr)
231232
: 0;
232233
InstructionCost LoadCost =
233-
VF * (AddrExtractCost + getMemoryOpCost(Opcode, VT->getElementType(),
234-
Alignment, 0, CostKind));
234+
VF *
235+
(AddrExtractCost + getMemoryOpCost(Opcode, VT->getElementType(),
236+
Alignment, AddressSpace, CostKind));
235237

236238
// Next, compute the cost of packing the result in a vector.
237239
InstructionCost PackingCost =
@@ -1369,6 +1371,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
13691371
InstructionCost getMaskedMemoryOpCost(unsigned Opcode, Type *DataTy,
13701372
Align Alignment, unsigned AddressSpace,
13711373
TTI::TargetCostKind CostKind) {
1374+
// TODO: Pass on AddressSpace when we have test coverage.
13721375
return getCommonMaskedMemoryOpCost(Opcode, DataTy, Alignment, true, false,
13731376
CostKind);
13741377
}

0 commit comments

Comments
 (0)