llvm-project/llvm/test
Chandler Carruth 1d96311447 [PM] Provide an initial, minimal port of the inliner to the new pass manager.
This doesn't implement *every* feature of the existing inliner, but
tries to implement the most important ones for building a functional
optimization pipeline and beginning to sort out bugs, regressions, and
other problems.

Notable, but intentional omissions:
- No alloca merging support. Why? Because it isn't clear we want to do
  this at all. Active discussion and investigation is going on to remove
  it, so for simplicity I omitted it.
- No support for trying to iterate on "internally" devirtualized calls.
  Why? Because it adds what I suspect is inappropriate coupling for
  little or no benefit. We will have an outer iteration system that
  tracks devirtualization including that from function passes and
  iterates already. We should improve that rather than approximate it
  here.
- Optimization remarks. Why? Purely to make the patch smaller, no other
  reason at all.

The last one I'll probably work on almost immediately. But I wanted to
skip it in the initial patch to try to focus the change as much as
possible as there is already a lot of code moving around and both of
these *could* be skipped without really disrupting the core logic.

A summary of the different things happening here:

1) Adding the usual new PM class and rigging.

2) Fixing minor underlying assumptions in the inline cost analysis or
   inline logic that don't generally hold in the new PM world.

3) Adding the core pass logic which is in essence a loop over the calls
   in the nodes in the call graph. This is a bit duplicated from the old
   inliner, but only a handful of lines could realistically be shared.
   (I tried at first, and it really didn't help anything.) All told,
   this is only about 100 lines of code, and most of that is the
   mechanics of wiring up analyses from the new PM world.

4) Updating the LazyCallGraph (in the new PM) based on the *newly
   inlined* calls and references. This is very minimal because we cannot
   form cycles.

5) When inlining removes the last use of a function, eagerly nuking the
   body of the function so that any "one use remaining" inline cost
   heuristics are immediately refined, and queuing these functions to be
   completely deleted once inlining is complete and the call graph
   updated to reflect that they have become dead.

6) After all the inlining for a particular function, updating the
   LazyCallGraph and the CGSCC pass manager to reflect the
   function-local simplifications that are done immediately and
   internally by the inline utilties. These are the exact same
   fundamental set of CG updates done by arbitrary function passes.

7) Adding a bunch of test cases to specifically target CGSCC and other
   subtle aspects in the new PM world.

Many thanks to the careful review from Easwaran and Sanjoy and others!

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

llvm-svn: 290161
2016-12-20 03:15:32 +00:00
..
Analysis Add files I seem to have dropped in my revert (r290086). 2016-12-19 08:32:13 +00:00
Assembler [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
Bindings [C API] Prevent nullptr dereferences in C API for counting attributes. 2016-11-15 22:19:59 +00:00
Bitcode [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
BugPoint
CodeGen [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
DebugInfo [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
Examples
ExecutionEngine Fix R_AARCH64_MOVW_UABS_G3 relocation 2016-12-15 22:36:53 +00:00
Feature
FileCheck [FileCheck] Fix --strict-whitespace --match-full-lines -- add test-case 2016-12-18 21:04:47 +00:00
Instrumentation [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
Integer
JitListener
LTO [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
LibDriver LibDriver: Allow resource files to be archive members. 2016-12-15 19:37:46 +00:00
Linker [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
MC AMDGPU: [AMDGPU] Assembler: add .hsa_code_object_metadata directive for functime metadata V2.0 2016-12-19 11:43:15 +00:00
Object Object: Make IRObjectFile own multiple modules and enumerate symbols from all modules. 2016-12-13 20:20:17 +00:00
ObjectYAML Revert "[ObjectYAML] Support for DWARF debug_info section" 2016-12-20 00:42:06 +00:00
Other [PM] Further broaden this test's regex as both the CGSCC and Function 2016-12-10 07:59:59 +00:00
SymbolRewriter
TableGen [tablegen] Delete duplicates from a vector without skipping elements 2016-12-01 19:38:50 +00:00
ThinLTO/X86 [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
Transforms [PM] Provide an initial, minimal port of the inliner to the new pass manager. 2016-12-20 03:15:32 +00:00
Unit
Verifier [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
YAMLParser
tools [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
.clang-format
CMakeLists.txt Add llvm-modextract tool. 2016-11-29 21:54:33 +00:00
TestRunner.sh
lit.cfg lit.cfg: Check value of build config rather than converting to boolean 2016-12-14 17:05:34 +00:00
lit.site.cfg.in Revert gold part of change, just liblto 2016-12-14 16:20:25 +00:00