diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2016-11-28 03:40:33 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2016-11-28 03:40:33 +0000 |
commit | 4cf2c89883717c481619946c68e14709c9613e90 (patch) | |
tree | 74dc5f9cebe2e8de6e9ba827bc5f9c7e5e1a4e25 /llvm/unittests/Analysis/CGSCCPassManagerTest.cpp | |
parent | 8e67000f1a0a9a03b6f8a002a01d7c3fd7b945b6 (diff) | |
download | bcm5719-llvm-4cf2c89883717c481619946c68e14709c9613e90.tar.gz bcm5719-llvm-4cf2c89883717c481619946c68e14709c9613e90.zip |
[PM] Add an ASCII-art diagram for the call graph in the CGSCC unit test.
No functionality changed.
llvm-svn: 288013
Diffstat (limited to 'llvm/unittests/Analysis/CGSCCPassManagerTest.cpp')
-rw-r--r-- | llvm/unittests/Analysis/CGSCCPassManagerTest.cpp | 81 |
1 files changed, 49 insertions, 32 deletions
diff --git a/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp b/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp index 9e18bb1ecec..643af94674e 100644 --- a/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp +++ b/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp @@ -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); }); |