[llvm] [CostModel] Add a DstTy to getShuffleCost (PR #141634)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 10:14:09 PDT 2025


================
@@ -1360,16 +1360,17 @@ class TargetTransformInfo {
       const SmallBitVector &OpcodeMask,
       TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput) const;
 
-  /// \return The cost of a shuffle instruction of kind Kind and of type Tp.
-  /// The exact mask may be passed as Mask, or else the array will be empty.
-  /// The index and subtype parameters are used by the subvector insertion and
-  /// extraction shuffle kinds to show the insert/extract point and the type of
-  /// the subvector being inserted/extracted. The operands of the shuffle can be
-  /// passed through \p Args, which helps improve the cost estimation in some
-  /// cases, like in broadcast loads.
-  /// NOTE: For subvector extractions Tp represents the source type.
+  /// \return The cost of a shuffle instruction of kind Kind with inputs of type
+  /// SrcTy, producing a vector of type DstTy. The exact mask may be passed as
+  /// Mask, or else the array will be empty. The index and subtype parameters
+  /// are used by the subvector insertion and extraction shuffle kinds to show
+  /// the insert/extract point and the type of the subvector being
+  /// inserted/extracted. The operands of the shuffle can be passed through \p
+  /// Args, which helps improve the cost estimation in some cases, like in
+  /// broadcast loads.
   InstructionCost
-  getShuffleCost(ShuffleKind Kind, VectorType *Tp, ArrayRef<int> Mask = {},
+  getShuffleCost(ShuffleKind Kind, VectorType *DstTy, VectorType *SrcTy,
+                 ArrayRef<int> Mask = {},
                  TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
                  int Index = 0, VectorType *SubTp = nullptr,
----------------
RKSimon wrote:

Do we need SubTy any more then?

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


More information about the llvm-commits mailing list