[llvm-branch-commits] [llvm] [TTI][SLP] Pass the scalars of the lanes to getArithmeticInstrCost (PR #241758)

Simon Pilgrim via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 17 07:51:34 PST 2026


================
@@ -1633,12 +1633,16 @@ class TargetTransformInfo {
   /// provide even more information.
   /// \p TLibInfo is used to search for platform specific vector library
   /// functions for instructions that might be converted to calls (e.g. frem).
+  /// \p Scalars are the scalar instructions of the lanes of a vector operation,
+  /// if known. The target may use them for the properties that differ between
+  /// the lanes, where \p CtxI shows only one lane.
   LLVM_ABI InstructionCost getArithmeticInstrCost(
       unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
       TTI::OperandValueInfo Opd1Info = {TTI::OK_AnyValue, TTI::OP_None},
       TTI::OperandValueInfo Opd2Info = {TTI::OK_AnyValue, TTI::OP_None},
       ArrayRef<const Value *> Args = {}, const Instruction *CtxI = nullptr,
-      const TargetLibraryInfo *TLibInfo = nullptr) const;
+      const TargetLibraryInfo *TLibInfo = nullptr,
+      ArrayRef<const Value *> Scalars = {}) const;
----------------
RKSimon wrote:

Anyone else feel like we should be considering equivalent to IntrinsicCostAttributes to wrap all this data?

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


More information about the llvm-branch-commits mailing list