41 void runOnOperation()
override {
42 markAllAnalysesPreserved();
44 auto &cga = getAnalysis<llzk::CallGraphAnalysis>();
53 void runOnOperation()
override {
54 markAllAnalysesPreserved();
57 auto &CG = getAnalysis<llzk::CallGraphAnalysis>();
59 os <<
"SCCs for the program in PostOrder:";
60 for (
auto SCCI = llvm::scc_begin<const llzk::CallGraph *>(&CG.getCallGraph()); !SCCI.isAtEnd();
62 const std::vector<const llzk::CallGraphNode *> &nextSCC = *SCCI;
63 os <<
"\nSCC #" << ++sccNum <<
": ";
71 if (CGN->isExternal()) {
72 os <<
"external node";
74 mlir::CallableOpInterface calledFn = CGN->getCalledFunction();
75 auto calledSym = llvm::dyn_cast<mlir::SymbolOpInterface>(calledFn.getOperation());
76 assert(calledSym &&
"call graph nodes must refer to callable symbols");
81 if (nextSCC.size() == 1 && SCCI.hasCycle()) {
82 os <<
" (Has self-loop).";
mlir::SymbolRefAttr getFullyQualifiedName(mlir::SymbolOpInterface symbol, bool requireParent=true)
Return the full name for this symbol from the root module, including any surrounding symbol table nam...