[llvm] [Analysis] Add function-scoped DDG DOT printer (dot-function-ddg) (PR #209089)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 01:00:05 PDT 2026


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,h -- llvm/include/llvm/Analysis/FunctionDDGPrinter.h llvm/lib/Analysis/FunctionDDGPrinter.cpp llvm/lib/Passes/PassBuilder.cpp --diff_from_common_commit
``````````

: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/Analysis/FunctionDDGPrinter.cpp b/llvm/lib/Analysis/FunctionDDGPrinter.cpp
index 596001b45..27d11080a 100644
--- a/llvm/lib/Analysis/FunctionDDGPrinter.cpp
+++ b/llvm/lib/Analysis/FunctionDDGPrinter.cpp
@@ -35,8 +35,8 @@ static cl::opt<std::string> FunctionDDGDotFilenamePrefix(
     "dot-function-ddg-filename-prefix", cl::init("ddg"), cl::Hidden,
     cl::desc("The prefix used for the function DDG dot file names."));
 
-PreservedAnalyses
-FunctionDDGDotPrinterPass::run(Function &F, FunctionAnalysisManager &AM) {
+PreservedAnalyses FunctionDDGDotPrinterPass::run(Function &F,
+                                                 FunctionAnalysisManager &AM) {
   auto &DI = AM.getResult<DependenceAnalysis>(F);
   DataDependenceGraph G(F, DI);
 
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 2cfcb15d6..68c785226 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -32,7 +32,6 @@
 #include "llvm/Analysis/CycleAnalysis.h"
 #include "llvm/Analysis/DDG.h"
 #include "llvm/Analysis/DDGPrinter.h"
-#include "llvm/Analysis/FunctionDDGPrinter.h"
 #include "llvm/Analysis/DXILMetadataAnalysis.h"
 #include "llvm/Analysis/DXILResource.h"
 #include "llvm/Analysis/Delinearization.h"
@@ -41,6 +40,7 @@
 #include "llvm/Analysis/DomPrinter.h"
 #include "llvm/Analysis/DominanceFrontier.h"
 #include "llvm/Analysis/EphemeralValuesCache.h"
+#include "llvm/Analysis/FunctionDDGPrinter.h"
 #include "llvm/Analysis/FunctionPropertiesAnalysis.h"
 #include "llvm/Analysis/GlobalsModRef.h"
 #include "llvm/Analysis/HashRecognize.h"

``````````

</details>


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


More information about the llvm-commits mailing list