This is an archive of the discontinued LLVM Phabricator instance.

[mlir][CallGraph] Add special call graph node for representing unknown callees
ClosedPublic

Authored by zero9178 on Sep 9 2022, 9:58 AM.

Details

Summary

The callgraph currently contains a special external node that is used both as the quasi caller for any externally callable as well as callees that could not be resolved.
This has one negative side effect however, which is the motivation for this patch: It leads to every externally callable which contains a call that could not be resolved (eg. an indirect call), to be put into one giant SCC when iterating over the SCCs of the call graph.

This patch fixes that issue by creating a second special callgraph node that acts as the callee for any unresolved callable. This breaks the cycles produced in the callgraph, yielding proper SCCs for all direct calls.

Diff Detail

Event Timeline

zero9178 created this revision.Sep 9 2022, 9:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 9:58 AM
zero9178 requested review of this revision.Sep 9 2022, 9:58 AM
rriddle accepted this revision.Sep 9 2022, 11:07 AM
This revision is now accepted and ready to land.Sep 9 2022, 11:07 AM