54 mlir::CallableOpInterface A, mlir::CallableOpInterface B
56 if (isReachableCached(A, B)) {
60 auto *startNode = callGraph.get().lookupNode(A.getCallableRegion());
62 const char *msg =
"CallGraph contains no starting node!";
63 A.emitError(msg).report();
64 llvm::report_fatal_error(msg);
73 auto dfsIt = llvm::df_begin<const CallGraphNode *>(startNode);
74 auto dfsEnd = llvm::df_end<const CallGraphNode *>(startNode);
75 for (; dfsIt != dfsEnd; ++dfsIt) {
83 for (
unsigned i = 0; i < dfsIt.getPathLength(); i++) {
84 mlir::CallableOpInterface ancestor = dfsIt.getPath(i)->getCalledFunction();
85 reachabilityMap[ancestor].insert(current);
88 if (isReachableCached(current, B)) {