[llvm] r288013 - [PM] Add an ASCII-art diagram for the call graph in the CGSCC unit test.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 19:40:34 PST 2016


Author: chandlerc
Date: Sun Nov 27 21:40:33 2016
New Revision: 288013

URL: http://llvm.org/viewvc/llvm-project?rev=288013&view=rev
Log:
[PM] Add an ASCII-art diagram for the call graph in the CGSCC unit test.

No functionality changed.

Modified:
    llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp

Modified: llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp?rev=288013&r1=288012&r2=288013&view=diff
==============================================================================
--- llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp (original)
+++ llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp Sun Nov 27 21:40:33 2016
@@ -177,38 +177,55 @@ protected:
 public:
   CGSCCPassManagerTest()
       : FAM(/*DebugLogging*/ true), CGAM(/*DebugLogging*/ true),
-        MAM(/*DebugLogging*/ true), M(parseIR("define void @f() {\n"
-                                              "entry:\n"
-                                              "  call void @g()\n"
-                                              "  call void @h1()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @g() {\n"
-                                              "entry:\n"
-                                              "  call void @g()\n"
-                                              "  call void @x()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @h1() {\n"
-                                              "entry:\n"
-                                              "  call void @h2()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @h2() {\n"
-                                              "entry:\n"
-                                              "  call void @h3()\n"
-                                              "  call void @x()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @h3() {\n"
-                                              "entry:\n"
-                                              "  call void @h1()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @x() {\n"
-                                              "entry:\n"
-                                              "  ret void\n"
-                                              "}\n")) {
+        MAM(/*DebugLogging*/ true),
+        M(parseIR(
+            // Define a module with the following call graph, where calls go
+            // out the bottom of nodes and enter the top:
+            //
+            // f
+            // |\   _
+            // | \ / |
+            // g  h1 |
+            // |  |  |
+            // |  h2 |
+            // |  |  |
+            // |  h3 |
+            // | / \_/
+            // |/
+            // x
+            //
+            "define void @f() {\n"
+            "entry:\n"
+            "  call void @g()\n"
+            "  call void @h1()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @g() {\n"
+            "entry:\n"
+            "  call void @g()\n"
+            "  call void @x()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @h1() {\n"
+            "entry:\n"
+            "  call void @h2()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @h2() {\n"
+            "entry:\n"
+            "  call void @h3()\n"
+            "  call void @x()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @h3() {\n"
+            "entry:\n"
+            "  call void @h1()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @x() {\n"
+            "entry:\n"
+            "  ret void\n"
+            "}\n")) {
     MAM.registerPass([&] { return LazyCallGraphAnalysis(); });
     MAM.registerPass([&] { return FunctionAnalysisManagerModuleProxy(FAM); });
     MAM.registerPass([&] { return CGSCCAnalysisManagerModuleProxy(CGAM); });




More information about the llvm-commits mailing list