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

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 00:34:59 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff c76045d9bf3bd1c7a381dc85d1db63a38fd69aa4 532984d89fec050a4147e4e73b1ba421d5dd57fd --extensions cpp,h -- llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
index 9ab5a77280..1fe0c5e8c0 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
@@ -469,11 +469,9 @@ bool SystemZTTIImpl::hasDivRemOp(Type *DataType, bool IsSigned) {
   return (VT.isScalarInteger() && TLI->isTypeLegal(VT));
 }
 
-InstructionCost SystemZTTIImpl::
-getScalarizationOverhead(VectorType *Ty,
-                         const APInt &DemandedElts,
-                         bool Insert, bool Extract,
-                         TTI::TargetCostKind CostKind) {
+InstructionCost SystemZTTIImpl::getScalarizationOverhead(
+    VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract,
+    TTI::TargetCostKind CostKind) {
   unsigned NumElts = cast<FixedVectorType>(Ty)->getNumElements();
   InstructionCost Cost = 0;
 
@@ -491,8 +489,8 @@ getScalarizationOverhead(VectorType *Ty,
     Insert = false;
   }
 
-  Cost += BaseT::getScalarizationOverhead(Ty, DemandedElts, Insert,
-                                          Extract, CostKind);
+  Cost += BaseT::getScalarizationOverhead(Ty, DemandedElts, Insert, Extract,
+                                          CostKind);
   return Cost;
 }
 
@@ -1394,8 +1392,8 @@ static cl::opt<unsigned> REDLIM("redlim", cl::init(0));
 InstructionCost getFPReductionCost(unsigned NumVec, unsigned ScalarBits) {
   unsigned NumEltsPerVecReg = (SystemZ::VectorBits / ScalarBits);
   InstructionCost Cost = 0;
-  Cost += NumVec - 1;        // Full vector operations.
-  Cost += NumEltsPerVecReg;  // Last vector scalar operations.
+  Cost += NumVec - 1;       // Full vector operations.
+  Cost += NumEltsPerVecReg; // Last vector scalar operations.
   return Cost;
 }
 

``````````

</details>


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


More information about the llvm-commits mailing list