llvm-6502/lib
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
..
Analysis [inliner] Completely change (and fix) how the inline cost analysis 2013-12-13 07:59:56 +00:00
AsmParser
Bitcode Remove unused value. 2013-12-07 02:27:52 +00:00
CodeGen Revert "DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers" 2013-12-13 06:43:32 +00:00
DebugInfo Revert "DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers" 2013-12-13 06:43:32 +00:00
ExecutionEngine Prune redundant dependencies in LLVMBuild.txt. 2013-12-11 00:30:57 +00:00
IR llvm-cov: Added -b option for branch probabilities. 2013-12-13 01:15:07 +00:00
IRReader
Linker
LTO Add TargetLibraryInfo in LTO passes builder 2013-12-12 01:37:39 +00:00
MC Revert "DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers" 2013-12-13 06:43:32 +00:00
Object Fix a pair of array index checks. 2013-12-06 02:33:38 +00:00
Option
Support Fix Typo. 2013-12-12 16:17:40 +00:00
TableGen
Target Change stack probing code for MingW. 2013-12-13 05:37:05 +00:00
Transforms Fix a use-after-free error in GlobalOpt CleanupConstantGlobalUsers 2013-12-12 20:45:24 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile