@@ -1574,18 +1574,6 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
15741574 /* IsGatherScatter*/ true , CostKind);
15751575 }
15761576
1577- InstructionCost getStridedMemoryOpCost (unsigned Opcode, Type *DataTy,
1578- const Value *Ptr, bool VariableMask,
1579- Align Alignment,
1580- TTI::TargetCostKind CostKind,
1581- const Instruction *I) const override {
1582- // For a target without strided memory operations (or for an illegal
1583- // operation type on one which does), assume we lower to a gather/scatter
1584- // operation. (Which may in turn be scalarized.)
1585- return thisT ()->getGatherScatterOpCost (Opcode, DataTy, Ptr, VariableMask,
1586- Alignment, CostKind, I);
1587- }
1588-
15891577 InstructionCost getInterleavedMemoryOpCost (
15901578 unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef<unsigned > Indices,
15911579 Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind,
@@ -1958,27 +1946,26 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
19581946 }
19591947 case Intrinsic::experimental_vp_strided_store: {
19601948 const Value *Data = Args[0 ];
1961- const Value *Ptr = Args[1 ];
19621949 const Value *Mask = Args[3 ];
19631950 const Value *EVL = Args[4 ];
19641951 bool VarMask = !isa<Constant>(Mask) || !isa<Constant>(EVL);
19651952 Type *EltTy = cast<VectorType>(Data->getType ())->getElementType ();
19661953 Align Alignment =
19671954 I->getParamAlign (1 ).value_or (thisT ()->DL .getABITypeAlign (EltTy));
1968- return thisT ()->getStridedMemoryOpCost (Instruction::Store,
1969- Data->getType (), Ptr , VarMask,
1970- Alignment , CostKind, I );
1955+ return thisT ()->getCommonMaskedMemoryOpCost (
1956+ Instruction::Store, Data->getType (), Alignment , VarMask,
1957+ /* IsGatherScatter */ true , CostKind);
19711958 }
19721959 case Intrinsic::experimental_vp_strided_load: {
1973- const Value *Ptr = Args[0 ];
19741960 const Value *Mask = Args[2 ];
19751961 const Value *EVL = Args[3 ];
19761962 bool VarMask = !isa<Constant>(Mask) || !isa<Constant>(EVL);
19771963 Type *EltTy = cast<VectorType>(RetTy)->getElementType ();
19781964 Align Alignment =
19791965 I->getParamAlign (0 ).value_or (thisT ()->DL .getABITypeAlign (EltTy));
1980- return thisT ()->getStridedMemoryOpCost (Instruction::Load, RetTy, Ptr,
1981- VarMask, Alignment, CostKind, I);
1966+ return thisT ()->getCommonMaskedMemoryOpCost (
1967+ Instruction::Load, RetTy, Alignment, VarMask,
1968+ /* IsGatherScatter*/ true , CostKind);
19821969 }
19831970 case Intrinsic::stepvector: {
19841971 if (isa<ScalableVectorType>(RetTy))
@@ -2418,17 +2405,21 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
24182405 }
24192406 case Intrinsic::experimental_vp_strided_store: {
24202407 auto *Ty = cast<VectorType>(ICA.getArgTypes ()[0 ]);
2421- Align Alignment = thisT ()->DL .getABITypeAlign (Ty->getElementType ());
2422- return thisT ()->getStridedMemoryOpCost (
2423- Instruction::Store, Ty, /* Ptr=*/ nullptr , /* VariableMask=*/ true ,
2424- Alignment, CostKind, ICA.getInst ());
2408+ Align Alignment = ICA.getAlign ().value_or (
2409+ thisT ()->DL .getABITypeAlign (Ty->getElementType ()));
2410+ return thisT ()->getCommonMaskedMemoryOpCost (
2411+ Instruction::Store, Ty, Alignment,
2412+ /* VariableMask=*/ true ,
2413+ /* IsGatherScatter*/ true , CostKind);
24252414 }
24262415 case Intrinsic::experimental_vp_strided_load: {
24272416 auto *Ty = cast<VectorType>(ICA.getReturnType ());
2428- Align Alignment = thisT ()->DL .getABITypeAlign (Ty->getElementType ());
2429- return thisT ()->getStridedMemoryOpCost (
2430- Instruction::Load, Ty, /* Ptr=*/ nullptr , /* VariableMask=*/ true ,
2431- Alignment, CostKind, ICA.getInst ());
2417+ Align Alignment = ICA.getAlign ().value_or (
2418+ thisT ()->DL .getABITypeAlign (Ty->getElementType ()));
2419+ return thisT ()->getCommonMaskedMemoryOpCost (
2420+ Instruction::Load, Ty, Alignment,
2421+ /* VariableMask=*/ true ,
2422+ /* IsGatherScatter*/ true , CostKind);
24322423 }
24332424 case Intrinsic::vector_reduce_add:
24342425 case Intrinsic::vector_reduce_mul:
0 commit comments