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

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 29 11:08:12 PST 2024


================
@@ -760,10 +760,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
   /// 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 *InTy,
-                                           const APInt &DemandedElts,
-                                           bool Insert, bool Extract,
-                                           TTI::TargetCostKind CostKind) {
+  InstructionCost getScalarizationOverhead(
+      VectorType *InTy, const APInt &DemandedElts, bool Insert, bool Extract,
+      TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = std::nullopt) {
+    assert((VL.empty() ||
+            VL.size() == cast<FixedVectorType>(InTy)->getNumElements()) &&
----------------
JonPsson1 wrote:

merged it with the other assertion that was already there...

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


More information about the llvm-commits mailing list