[llvm] Reapply "[nfc][mlgo] Incrementally update DominatorTreeAnalysis in FunctionPropertiesAnalysis (#104867) (PR #106288)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 15:38:58 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 fc517973c299d879f0795d37500a7db1f4d63588 630e7833dd6339ad4f63cd6f7621e08c1c676854 --extensions cpp,h -- llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp llvm/lib/Analysis/MLInlineAdvisor.cpp llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
index 96bfa5b5a7..bbb352950c 100644
--- a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
+++ b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
@@ -380,7 +380,7 @@ DominatorTree &FunctionPropertiesUpdater::getUpdatedDominatorTree(
   // successors of the callsite BB and prepared them for removal, but not all
   // may actually end up being removed. Check which actually survived.
   // Conversely, we won't re-add them.
-  DenseSet<const BasicBlock*> NewSuccessors;
+  DenseSet<const BasicBlock *> NewSuccessors;
   NewSuccessors.insert(succ_begin(&CallSiteBB), succ_end(&CallSiteBB));
   for (auto &Upd : DomTreeUpdates)
     if (Upd.getFrom() != &CallSiteBB || !NewSuccessors.contains(Upd.getTo()))
diff --git a/llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp b/llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
index 6a09118d21..b7c392c8b9 100644
--- a/llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
+++ b/llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
@@ -1055,10 +1055,11 @@ entry:
   )IR");
   auto *F1 = M->getFunction("f1");
   auto *F2 = M->getFunction("f2");
-  auto *CB = [&]() -> CallBase* {
+  auto *CB = [&]() -> CallBase * {
     for (auto &BB : *F1)
       for (auto &I : BB)
-        if (auto *CB = dyn_cast<CallBase>(&I); CB && CB->getCalledFunction() && CB->getCalledFunction() == F2)
+        if (auto *CB = dyn_cast<CallBase>(&I);
+            CB && CB->getCalledFunction() && CB->getCalledFunction() == F2)
           return CB;
     return nullptr;
   }();

``````````

</details>


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


More information about the llvm-commits mailing list