[llvm] [TTI] Use MemIntrinsicCostAttributes for getStridedOpCost (PR #170436)

Shih-Po Hung via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 3 00:22:32 PST 2025


================
@@ -1212,14 +1212,22 @@ InstructionCost RISCVTTIImpl::getExpandCompressMemoryOpCost(
          LT.first * getRISCVInstructionCost(Opcodes, LT.second, CostKind);
 }
 
-InstructionCost RISCVTTIImpl::getStridedMemoryOpCost(
-    unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask,
-    Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I) const {
+InstructionCost
+RISCVTTIImpl::getStridedMemoryOpCost(const MemIntrinsicCostAttributes &MICA,
+                                     TTI::TargetCostKind CostKind) const {
+
+  unsigned Opcode = MICA.getID() == Intrinsic::experimental_vp_strided_load
+                        ? Instruction::Load
+                        : Instruction::Store;
+
+  Type *DataTy = MICA.getDataType();
+  Align Alignment = MICA.getAlignment();
+  const Instruction *I = MICA.getInst();
+
   if (((Opcode == Instruction::Load || Opcode == Instruction::Store) &&
----------------
arcbbb wrote:

Given SLP is the only user, this appears to be defensive coding and the opcode should be either Load or Store.
I can clean it up while I’m here.

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


More information about the llvm-commits mailing list