summaryrefslogtreecommitdiff
path: root/test/Transforms/Inline/inline_returns_twice.ll
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-15 20:54:53 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-15 20:54:53 +0000
commite6725194d1045eeb5a9371316120b9b027f3d289 (patch)
treeec6eaadc782689d512f3332f419dc86e020866f9 /test/Transforms/Inline/inline_returns_twice.ll
parente74957a7744bcd1a912fc15a915af570bd7a9583 (diff)
downloadllvm-e6725194d1045eeb5a9371316120b9b027f3d289.tar.gz
llvm-e6725194d1045eeb5a9371316120b9b027f3d289.tar.bz2
llvm-e6725194d1045eeb5a9371316120b9b027f3d289.tar.xz
Merging r197215:
------------------------------------------------------------------------ r197215 | chandlerc | 2013-12-12 23:59:56 -0800 (Thu, 12 Dec 2013) | 24 lines [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/branches/release_34@197351 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/Inline/inline_returns_twice.ll')
0 files changed, 0 insertions, 0 deletions