llvm-6502/lib/Analysis/IPA
Chandler Carruth 0bdc7cd5de [inliner] Completely change (and fix) how the inline cost analysis
handles terminator instructions.

The inline cost analysis inheritted some pretty rough handling of
terminator insts from the original cost analysis, and then made it much,
much worse by factoring all of the important analyses into a separate
instruction visitor. That instruction visitor never visited the
terminator.

This works fine for things like conditional branches, but for many other
things we simply computed The Wrong Value. First example are
unconditional branches, which should be free but were counted as full
cost. This is most significant for conditional branches where the
condition simplifies and folds during inlining. We paid a 1 instruction
tax on every branch in a straight line specialized path. =[

Oh, we also claimed that the unreachable instruction had cost.

But it gets worse. Let's consider invoke. We never applied the call
penalty. We never accounted for the cost of the arguments. Nope. Worse
still, we didn't handle the *correctness* constraints of not inlining
recursive invokes, or exception throwing returns_twice functions. Oops.
See PR18206. Sadly, PR18206 requires yet another fix, but this
refactoring is at least a huge step in that direction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197215 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 07:59:56 +00:00
..
CallGraph.cpp [PM] Split the CallGraph out from the ModulePass which creates the 2013-11-26 04:19:30 +00:00
CallGraphSCCPass.cpp [PM] Split the CallGraph out from the ModulePass which creates the 2013-11-26 04:19:30 +00:00
CallPrinter.cpp [PM] Split the CallGraph out from the ModulePass which creates the 2013-11-26 04:19:30 +00:00
CMakeLists.txt Sink InlineCost.cpp into IPA -- it is now officially an interprocedural 2013-01-21 12:09:41 +00:00
FindUsedTypes.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
GlobalsModRef.cpp [PM] Split the CallGraph out from the ModulePass which creates the 2013-11-26 04:19:30 +00:00
InlineCost.cpp [inliner] Completely change (and fix) how the inline cost analysis 2013-12-13 07:59:56 +00:00
IPA.cpp [PM] Split the CallGraph out from the ModulePass which creates the 2013-11-26 04:19:30 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile