[llvm] [SLP]Exclude non-profitable subtrees. (PR #162018)

via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 5 07:52:59 PDT 2025


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 origin/main HEAD --extensions cpp -- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</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 b633dd4d9..95e4c7781 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -16129,10 +16129,11 @@ InstructionCost BoUpSLP::calculateTreeCostAndTrimNonProfitable(
 
   LLVM_DEBUG(dbgs() << "SLP: Recalculate costs after tree trimming.\n");
   Cost = 0;
-  for (const auto &P : NodesCosts){
+  for (const auto &P : NodesCosts) {
     Cost += P.second;
     LLVM_DEBUG(dbgs() << "SLP: Adding cost " << P.second << " for bundle "
-                      << shortBundleName(P.first->Scalars, P.first->Idx) << ".\n"
+                      << shortBundleName(P.first->Scalars, P.first->Idx)
+                      << ".\n"
                       << "SLP: Current total cost = " << Cost << "\n");
   }
   return Cost;
@@ -17897,7 +17898,7 @@ Value *BoUpSLP::gather(
       ArrayRef<TreeEntry *> Entries = getTreeEntries(V);
       const auto *It = find_if(Entries, [&](const TreeEntry *E) {
         return !TransformedToGatherNodes.contains(E) &&
-           !DeletedNodes.contains(E);
+               !DeletedNodes.contains(E);
       });
       if (It != Entries.end()) {
         // Find which lane we need to extract.

``````````

</details>


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


More information about the llvm-commits mailing list