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

Sergey Kachkov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 04:39:15 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(
----------------
skachkov-sc wrote:

getExpandCompressMemoryOpCost sounds better, changed the name

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


More information about the llvm-commits mailing list