llvm-project/llvm/lib
Chandler Carruth 5dbc164d15 [LCG] Add the necessary functionality to the LazyCallGraph to support inlining.
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 in order to isolate (with
unit tests) the logic that was entirely within the LCG.

Many thanks for the careful review from folks! There will be a few minor
follow-up patches based on the comments in the review as well.

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

llvm-svn: 283982
2016-10-12 07:59:56 +00:00
..
Analysis [LCG] Add the necessary functionality to the LazyCallGraph to support inlining. 2016-10-12 07:59:56 +00:00
AsmParser [AsmParser] Remove unused partial template specialization. 2016-09-22 22:02:59 +00:00
Bitcode ThinLTO: handles modules with empty summaries 2016-10-08 04:44:18 +00:00
CodeGen [DAG] Fix crash in build_vector -> vector_shuffle combine 2016-10-11 22:44:31 +00:00
DebugInfo Avoid braced initialization for default member initializers for MSVC 2013 2016-10-11 20:02:57 +00:00
Demangle Avoid using alignas and constexpr. 2016-09-06 20:36:24 +00:00
ExecutionEngine Use StringRef instead of raw pointer in ExecutionEngine 2016-10-01 06:22:04 +00:00
Fuzzer Revert "[libFuzzer] refactoring to speed things up, NFC" 2016-10-12 07:26:46 +00:00
IR Allow Switch instruction to have extractProfTotalWeight called as it can terminate a basic block. (NFC) 2016-10-11 18:53:00 +00:00
IRReader
LTO ThinLTO: don't perform incremental LTO on module without a hash 2016-10-08 04:44:23 +00:00
LibDriver Object: Replace NewArchiveIterator with a simpler NewArchiveMember class. NFCI. 2016-06-29 22:27:42 +00:00
LineEditor
Linker DebugInfo: New metadata representation for global variables. 2016-09-13 01:12:59 +00:00
MC Revert r283690, "MC: Remove unused entities." 2016-10-10 22:49:37 +00:00
Object Next set of additional error checks for invalid Mach-O files for the 2016-10-11 21:04:39 +00:00
ObjectYAML [macho2yaml] Don't write empty linkedit data 2016-08-17 21:46:04 +00:00
Option Generalize ArgList::AddAllArgs more 2016-09-29 19:47:58 +00:00
Passes Fix test after renaming -name-anon-functions pass to -name-anon-globals 2016-09-16 17:18:16 +00:00
ProfileData NFC Add const 2016-09-30 21:05:55 +00:00
Support Fix build error on LP64 platforms. 2016-10-11 19:28:56 +00:00
TableGen Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes. 2016-08-23 17:14:32 +00:00
Target [AArch64][InstrustionSelector] Teach the selector about G_BITCAST. 2016-10-12 03:57:52 +00:00
Transforms Memory-SSA cleanup of clobbers interface, NFC 2016-10-12 03:08:40 +00:00
CMakeLists.txt Try to fix a circular dependency in the modules build. 2016-09-06 20:16:19 +00:00
LLVMBuild.txt Add an c++ itanium demangler to llvm. 2016-09-06 19:16:48 +00:00