llvm.org GIT mirror llvm / 28f31d7
[PM] Add an ASCII-art diagram for the call graph in the CGSCC unit test. No functionality changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288013 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 2 years ago
1 changed file(s) with 49 addition(s) and 32 deletion(s). Raw diff Collapse all Expand all
176176 public:
177177 CGSCCPassManagerTest()
178178 : FAM(/*DebugLogging*/ true), CGAM(/*DebugLogging*/ true),
179 MAM(/*DebugLogging*/ true), M(parseIR("define void @f() {\n"
180 "entry:\n"
181 " call void @g()\n"
182 " call void @h1()\n"
183 " ret void\n"
184 "}\n"
185 "define void @g() {\n"
186 "entry:\n"
187 " call void @g()\n"
188 " call void @x()\n"
189 " ret void\n"
190 "}\n"
191 "define void @h1() {\n"
192 "entry:\n"
193 " call void @h2()\n"
194 " ret void\n"
195 "}\n"
196 "define void @h2() {\n"
197 "entry:\n"
198 " call void @h3()\n"
199 " call void @x()\n"
200 " ret void\n"
201 "}\n"
202 "define void @h3() {\n"
203 "entry:\n"
204 " call void @h1()\n"
205 " ret void\n"
206 "}\n"
207 "define void @x() {\n"
208 "entry:\n"
209 " ret void\n"
210 "}\n")) {
179 MAM(/*DebugLogging*/ true),
180 M(parseIR(
181 // Define a module with the following call graph, where calls go
182 // out the bottom of nodes and enter the top:
183 //
184 // f
185 // |\ _
186 // | \ / |
187 // g h1 |
188 // | | |
189 // | h2 |
190 // | | |
191 // | h3 |
192 // | / \_/
193 // |/
194 // x
195 //
196 "define void @f() {\n"
197 "entry:\n"
198 " call void @g()\n"
199 " call void @h1()\n"
200 " ret void\n"
201 "}\n"
202 "define void @g() {\n"
203 "entry:\n"
204 " call void @g()\n"
205 " call void @x()\n"
206 " ret void\n"
207 "}\n"
208 "define void @h1() {\n"
209 "entry:\n"
210 " call void @h2()\n"
211 " ret void\n"
212 "}\n"
213 "define void @h2() {\n"
214 "entry:\n"
215 " call void @h3()\n"
216 " call void @x()\n"
217 " ret void\n"
218 "}\n"
219 "define void @h3() {\n"
220 "entry:\n"
221 " call void @h1()\n"
222 " ret void\n"
223 "}\n"
224 "define void @x() {\n"
225 "entry:\n"
226 " ret void\n"
227 "}\n")) {
211228 MAM.registerPass([&] { return LazyCallGraphAnalysis(); });
212229 MAM.registerPass([&] { return FunctionAnalysisManagerModuleProxy(FAM); });
213230 MAM.registerPass([&] { return CGSCCAnalysisManagerModuleProxy(CGAM); });