[llvm] [TTI][Vectorize] Migrate masked/gather-scatter/strided/expand-compress costing (NFCI) (PR #165532)

Shih-Po Hung via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 01:59:20 PST 2025


================
@@ -3017,6 +3022,53 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
     return SingleCallCost;
   }
 
+  /// Get memory intrinsic cost based on arguments.
+  InstructionCost getMemIntrinsicInstrCost(Intrinsic::ID Id, Type *DataTy,
+                                           const Value *Ptr, bool VariableMask,
+                                           Align Alignment,
+                                           TTI::TargetCostKind CostKind,
+                                           const Instruction *I) const {
+    switch (Id) {
+    case Intrinsic::experimental_vp_strided_load:
+    case Intrinsic::experimental_vp_strided_store: {
+      unsigned Opcode = (Id == Intrinsic::experimental_vp_strided_load)
+                            ? Instruction::Load
+                            : Instruction::Store;
+      return thisT()->getStridedMemoryOpCost(Opcode, DataTy, Ptr, VariableMask,
----------------
arcbbb wrote:

Yes, getStridedMemoryOpCost was straightforward (RISCV-only). The others are implemented across several backends, so I’ll stage those as follow-ups with the relevant target reviewers

https://github.com/llvm/llvm-project/pull/165532


More information about the llvm-commits mailing list