[llvm] [SLP]Improved reduction cost/codegen (PR #118293)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 05:40:32 PST 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 5c181a9191bfb758575329ff7eb8db4fc46ffac9 2f17bfb2f9814b2a40fa1ced3947d5348e4a9d96 --extensions cpp,h -- llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/include/llvm/Analysis/TargetTransformInfoImpl.h llvm/include/llvm/CodeGen/BasicTTIImpl.h llvm/lib/Analysis/TargetTransformInfo.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 5df21b7764..38ccf4923b 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -19238,8 +19238,7 @@ class HorizontalReduction {
     case RecurKind::Or:
       if (UseSelect && OpTy == CmpInst::makeCmpResultType(OpTy))
         return Builder.CreateSelect(
-            LHS,
-            ConstantInt::getAllOnesValue(CmpInst::makeCmpResultType(OpTy)),
+            LHS, ConstantInt::getAllOnesValue(CmpInst::makeCmpResultType(OpTy)),
             RHS, Name);
       return Builder.CreateBinOp((Instruction::BinaryOps)RdxOpcode, LHS, RHS,
                                  Name);
@@ -20150,7 +20149,8 @@ public:
                                Lane->getType()->getScalarType() !=
                                        VL.front()->getType()->getScalarType()
                                    ? V.isSignedMinBitwidthRootNode()
-                                   : true, RdxRootInst->getType());
+                                   : true,
+                               RdxRootInst->getType());
             ReducedSubTree =
                 Builder.CreateInsertElement(ReducedSubTree, Val, I);
           }

``````````

</details>


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


More information about the llvm-commits mailing list