[llvm] [SLP][TTI]Add support for strided loads. (PR #80310)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 09:53:58 PST 2024


================
@@ -687,6 +691,15 @@ class TargetTransformInfoImplBase {
     return 1;
   }
 
+  InstructionCost getStridedMemoryOpCost(unsigned Opcode, Type *DataTy,
+                                         const Value *Ptr, bool VariableMask,
+                                         Align Alignment,
+                                         TTI::TargetCostKind CostKind,
+                                         const Instruction *I = nullptr) const {
+    return CostKind == TTI::TCK_RecipThroughput ? TTI::TCC_Expensive
----------------
preames wrote:

InstructionCost::getInvalid() is likely a better default here.

For codesize, you could reasonable use TCC_Basic for a *legal* strided load or store.

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


More information about the llvm-commits mailing list