1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 13:33:37 +02:00
llvm-mirror/lib/Transforms/IPO
Chandler Carruth 90665f11d7 [PM] Port the always inliner to the new pass manager in a much more
minimal and boring form than the old pass manager's version.

This pass does the very minimal amount of work necessary to inline
functions declared as always-inline. It doesn't support a wide array of
things that the legacy pass manager did support, but is alse ... about
20 lines of code. So it has that going for it. Notably things this
doesn't support:

- Array alloca merging
  - To support the above, bottom-up inlining with careful history
    tracking and call graph updates
- DCE of the functions that become dead after this inlining.
- Inlining through call instructions with the always_inline attribute.
  Instead, it focuses on inlining functions with that attribute.

The first I've omitted because I'm hoping to just turn it off for the
primary pass manager. If that doesn't pan out, I can add it here but it
will be reasonably expensive to do so.

The second should really be handled by running global-dce after the
inliner. I don't want to re-implement the non-trivial logic necessary to
do comdat-correct DCE of functions. This means the -O0 pipeline will
have to be at least 'always-inline,global-dce', but that seems
reasonable to me. If others are seriously worried about this I'd like to
hear about it and understand why. Again, this is all solveable by
factoring that logic into a utility and calling it here, but I'd like to
wait to do that until there is a clear reason why the existing
pass-based factoring won't work.

The final point is a serious one. I can fairly easily add support for
this, but it seems both costly and a confusing construct for the use
case of the always inliner running at -O0. This attribute can of course
still impact the normal inliner easily (although I find that
a questionable re-use of the same attribute). I've started a discussion
to sort out what semantics we want here and based on that can figure out
if it makes sense ta have this complexity at O0 or not.

One other advantage of this design is that it should be quite a bit
faster due to checking for whether the function is a viable candidate
for inlining exactly once per function instead of doing it for each call
site.

Anyways, hopefully a reasonable starting point for this pass.

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

llvm-svn: 278896
2016-08-17 02:56:20 +00:00
..
AlwaysInliner.cpp [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
ArgumentPromotion.cpp [ArgPromote] Use function_ref and for-range loops. 2016-07-09 10:36:36 +00:00
BarrierNoopPass.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
CMakeLists.txt [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
ConstantMerge.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
CrossDSOCFI.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
DeadArgumentElimination.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
ElimAvailExtern.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
ExtractGV.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
ForceFunctionAttrs.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
FunctionAttrs.cpp IPO: Swap || operands to avoid dereferencing end() 2016-08-17 01:23:58 +00:00
FunctionImport.cpp FunctionImport: missed one occurence of ImportListForModule to rename (NFC) 2016-08-16 05:49:12 +00:00
GlobalDCE.cpp IR: Introduce Module::global_objects(). 2016-06-22 20:29:42 +00:00
GlobalOpt.cpp Use range algorithms instead of unpacking begin/end 2016-08-11 21:15:00 +00:00
InferFunctionAttrs.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
Inliner.cpp [Inliner] Add a flag to disable manual alloca merging in the Inliner. 2016-08-17 02:40:23 +00:00
InlineSimple.cpp Add a new method to create SimpleInliner instance and make pre-inliner use this. 2016-08-11 18:24:08 +00:00
Internalize.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
IPConstantPropagation.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
IPO.cpp [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
LLVMBuild.txt [PGO] Passmanagerbuilder change that enable IR level PGO instrumentation 2016-01-21 18:28:59 +00:00
LoopExtractor.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
LowerTypeTests.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
MergeFunctions.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
PartialInlining.cpp CodeExtractor : Add ability to preserve profile data. 2016-08-02 02:15:45 +00:00
PassManagerBuilder.cpp Add a new method to create SimpleInliner instance and make pre-inliner use this. 2016-08-11 18:24:08 +00:00
PruneEH.cpp [PM] Some preparatory refactoring to minimize the diff of D21921 2016-07-02 19:12:56 +00:00
SampleProfile.cpp Fine tuning of sample profile propagation algorithm. 2016-08-12 16:22:12 +00:00
StripDeadPrototypes.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
StripSymbols.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
WholeProgramDevirt.cpp WholeProgramDevirt: initialize WasDevirt in all constructors. 2016-08-12 01:40:10 +00:00