llvm-6502/test/Transforms/Inline
Chandler Carruth 34afa06cf2 [inliner] Fix the early-exit of the inline cost analysis to correctly
model the dense vector instruction bonuses.

Previously, this code really didn't effectively compute the density of
inlined vector instructions and apply the intended inliner bonus. It
would try to compute it repeatedly while analyzing the function and
didn't handle the case where future vector instructions would tip the
scales back towards the bonus.

Instead, speculatively apply all possible bonuses to the threshold
initially. Once we *know* that a certain bonus can not be applied,
subtract it. This should delay early bailout enough to get much more
consistent results without actually causing us to analyze huge swaths of
code. I expect some (hopefully mild) compile time hit here, and some
swings in performance, but this was definitely the intended behavior of
these bonuses.

This also dramatically simplifies the computation of the bonuses to not
interact with each other in confusing ways. The previous code didn't do
a good job of this and the values for bonuses may be surprising but are
at least now clearly written in the code.

Finally, fix code to be in line with comments and use zero as the
bailout condition.

Patch by Easwaran Raman, with some comment tweaks by me to try and
further clarify what is going on with this code.

http://reviews.llvm.org/D8267

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 02:49:05 +00:00
..
2003-09-14-InlineValue.ll
2003-09-22-PHINodeInlineFail.ll Verifier: Call verifyModule() from llc and opt 2015-03-27 22:04:28 +00:00
2003-09-22-PHINodesInExceptionDest.ll Verifier: Call verifyModule() from llc and opt 2015-03-27 22:04:28 +00:00
2003-09-22-PHINodesInNormalInvokeDest.ll
2003-10-13-AllocaDominanceProblem.ll
2004-04-15-InlineDeletesCall.ll
2004-04-20-InlineLinkOnce.ll
2004-10-17-InlineFunctionWithoutReturn.ll
2006-01-14-CallGraphUpdate.ll
2006-07-12-InlinePruneCGUpdate.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
2006-11-09-InlineCGUpdate-2.ll
2006-11-09-InlineCGUpdate.ll
2007-04-15-InlineEH.ll
2007-06-25-WeakInline.ll
2007-12-19-InlineNoUnwind.ll
2008-09-02-NoInline.ll
2009-01-08-NoInlineDynamicAlloca.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
2009-01-13-RecursiveInlineCrash.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
2009-05-07-CallUsingSelfCrash.ll
2010-05-12-ValueMap.ll
align.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
alloca_test.ll
alloca-bonus.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
alloca-dbgdeclare.ll IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
alloca-in-scc.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
alloca-merge-align.ll Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
always-inline.ll
array_merge.ll
attributes.ll [inliner] Don't inline a function if it doesn't have exactly the same 2015-04-13 18:43:38 +00:00
basictest.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
blockaddress.ll
byval_lifetime.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
byval-tail-call.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
byval.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
callgraph-update.ll
casts.ll
cfg_preserve_test.ll
crash2.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
crash-lifetime-marker.ll [InlineFunction] Don't add lifetime markers for zero-sized allocas. 2015-04-20 16:11:05 +00:00
crash.ll
debug-info-duplicate-calls.ll IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
debug-invoke.ll IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
delete-call.ll
devirtualize-2.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
devirtualize-3.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
devirtualize.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
dynamic_alloca_test.ll
ephemeral.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
externally_available.ll
frameescape.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
gvn-inline-iteration.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
ignore-debug-info.ll IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
inline_cleanup.ll
inline_constprop.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
inline_dbg_declare.ll IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
inline_dce.ll
inline_invoke.ll
inline_minisize.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
inline_prune.ll
inline_returns_twice.ll
inline_ssp.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
inline-byval-bonus.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
inline-cold.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
inline-fast-math-flags.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
inline-fp.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
inline-indirect.ll Fix a crash in the assumption cache when inlining indirect function calls 2015-02-12 21:04:22 +00:00
inline-invoke-tail.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
inline-invoke-with-asm-call.ll
inline-musttail-varargs.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
inline-optnone.ll
inline-optsize.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
inline-tail.ll Revert "Transforms: reapply SVN r219899" 2014-11-04 02:02:14 +00:00
inline-vla.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
invoke_test-1.ll
invoke_test-2.ll
invoke_test-3.ll
invoke-cleanup.ll
invoke-combine-clauses.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
invoke-cost.ll
lifetime-no-datalayout.ll Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
lifetime.ll
nested-inline.ll
noalias2.ll Changed renaming of local symbols by inserting a dot vefore the numeric suffix. 2015-05-12 16:47:30 +00:00
noalias-calls.ll IR: Add 'distinct' MDNodes to bitcode and assembly 2015-01-08 22:38:29 +00:00
noalias-cs.ll Changed renaming of local symbols by inserting a dot vefore the numeric suffix. 2015-05-12 16:47:30 +00:00
noalias.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
noinline-recursive-fn.ll
noinline.ll
null-function.ll
optimization-remarks.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
pr21206.ll Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
pr22285.ll [Inliner] Discard empty COMDAT groups 2015-05-05 20:14:22 +00:00
PR4909.ll
ptr-diff.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
recursive.ll
store-sroa.ll Correctly estimate SROA savings for store operands in inline cost analysis. 2015-03-20 18:33:12 +00:00
switch.ll
vector-bonus.ll [inliner] Fix the early-exit of the inline cost analysis to correctly 2015-05-27 02:49:05 +00:00