@@ -209,7 +209,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
209
209
Align Alignment,
210
210
bool VariableMask,
211
211
bool IsGatherScatter,
212
- TTI::TargetCostKind CostKind) {
212
+ TTI::TargetCostKind CostKind,
213
+ unsigned AddressSpace = 0 ) {
213
214
// We cannot scalarize scalable vectors, so return Invalid.
214
215
if (isa<ScalableVectorType>(DataTy))
215
216
return InstructionCost::getInvalid ();
@@ -230,8 +231,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
230
231
CostKind, -1 , nullptr , nullptr )
231
232
: 0 ;
232
233
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));
235
237
236
238
// Next, compute the cost of packing the result in a vector.
237
239
InstructionCost PackingCost =
@@ -1369,6 +1371,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
1369
1371
InstructionCost getMaskedMemoryOpCost (unsigned Opcode, Type *DataTy,
1370
1372
Align Alignment, unsigned AddressSpace,
1371
1373
TTI::TargetCostKind CostKind) {
1374
+ // TODO: Pass on AddressSpace when we have test coverage.
1372
1375
return getCommonMaskedMemoryOpCost (Opcode, DataTy, Alignment, true , false ,
1373
1376
CostKind);
1374
1377
}
0 commit comments