[llvm] [SystemZ] SLP reductions: cost functions of reductions and scalarization (PR #112491)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 12:51:34 PST 2024


================
@@ -898,11 +898,11 @@ class TargetTransformInfo {
 
   /// Estimate the overhead of scalarizing an instruction. Insert and Extract
   /// are set if the demanded result elements need to be inserted and/or
-  /// extracted from vectors.
-  InstructionCost getScalarizationOverhead(VectorType *Ty,
-                                           const APInt &DemandedElts,
-                                           bool Insert, bool Extract,
-                                           TTI::TargetCostKind CostKind) const;
+  /// extracted from vectors.  The involved values may be passed in VL if
+  /// Insert is true.
+  InstructionCost getScalarizationOverhead(
+      VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract,
+      TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = std::nullopt) const;
----------------
alexey-bataev wrote:

```suggestion
      TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = {}) const;
```
IIRC, std::nullopt is going to be deprecated/dleted for ArrayRef initialization

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


More information about the llvm-commits mailing list