[llvm] [TTI][CostModel] Add cost modeling for expandload and compressstore intrinsics (PR #122882)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 10:05:58 PST 2025


================
@@ -1492,6 +1492,19 @@ class TargetTransformInfo {
       Align Alignment, TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
       const Instruction *I = nullptr) const;
 
+  /// \return The cost of Expand Load or Compress Store operation
+  /// \p Opcode - is a type of memory access Load or Store
+  /// \p Src - a vector type of the data to be loaded or stored
+  /// \p VariableMask - true when the memory access is predicated with a mask
+  ///                   that is not a compile-time constant
+  /// \p Alignment - alignment of single element
+  /// \p I - the optional original context instruction, if one exists, e.g. the
+  ///        load/store to transform or the call to the gather/scatter intrinsic
+  InstructionCost getConsecutiveMemoryOpCost(
----------------
preames wrote:

Calling these "Consecutive" operations seems likely to be confusing.  To me, I'd assume that meant unit strided load or store.

There's already precedent in this API for using the terms expand and compress.  Maybe getExpandCompressMemoryOpCost?

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


More information about the llvm-commits mailing list