[PATCH] D24225: [LCG] Add the necessary functionality to the LazyCallGraph to support inlining.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 5 00:59:14 PDT 2016


chandlerc created this revision.
chandlerc added a reviewer: sanjoy.
chandlerc added a subscriber: llvm-commits.
chandlerc added a dependency: D24219: [LCG] Redesign the lazy post-order iteration mechanism for the LazyCallGraph to support repeated, stable iterations, even in the face of graph updates..
Herald added a subscriber: mcrosier.

The basic inlining operation makes the following changes to the call graph:
1) Add edges that were previously transitive edges. This is always trivial and
   this patch gives the LCG helper methods to make this more convenient.
2) Remove the inlined edge. We had existing support for this, but it contained
   bugs that needed to be fixed. Testing in the same pattern as the inliner
   exposes these bugs very nicely.
3) Delete a function when it becomes dead because it is internal and all calls
   have been inlined. The LCG had no support at all for this operation, so this
   adds that support.

Two unittests have been added that exercise this specific mutation pattern to
the call graph. They were extremely effective in uncovering bugs. Sadly,
a large fraction of the code here is just to implement those unit tests, but
I think they're paying for themselves. =]

This was split out of a patch that actually uses the routines to implement
inlining in the new pass manager. I'll send it out next, I just wanted to
isolate (with unit tests) the logic that was entirely within the LCG.

Depends on D24219

https://reviews.llvm.org/D24225

Files:
  include/llvm/Analysis/LazyCallGraph.h
  lib/Analysis/LazyCallGraph.cpp
  unittests/Analysis/LazyCallGraphTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24225.70306.patch
Type: text/x-patch
Size: 24653 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160905/38723245/attachment.bin>


More information about the llvm-commits mailing list