[all-commits] [llvm/llvm-project] 82f86b: [mlir][CallGraph] Add special call graph node for ...

zero9178 via All-commits all-commits at lists.llvm.org
Fri Sep 9 11:23:19 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 82f86b862b8ba9b1c6d91a32c88907f0dad6c3d2
      https://github.com/llvm/llvm-project/commit/82f86b862b8ba9b1c6d91a32c88907f0dad6c3d2
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2022-09-09 (Fri, 09 Sep 2022)

  Changed paths:
    M mlir/include/mlir/Analysis/CallGraph.h
    M mlir/lib/Analysis/CallGraph.cpp
    M mlir/test/Analysis/test-callgraph.mlir

  Log Message:
  -----------
  [mlir][CallGraph] Add special call graph node for representing unknown callees

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.

Differential Revision: https://reviews.llvm.org/D133585




More information about the All-commits mailing list