llvm-6502/test/Transforms/Inline
Benjamin Kramer b6fdd022b7 PR13095: Give an inline cost bonus to functions using byval arguments.
We give a bonus for every argument because the argument setup is not needed
anymore when the function is inlined. With this patch we interpret byval
arguments as a compact representation of many arguments. The byval argument
setup is implemented in the backend as an inline memcpy, so to model the
cost as accurately as possible we take the number of pointer-sized elements
in the byval argument and give a bonus of 2 instructions for every one of
those. The bonus is capped at 8 elements, which is the number of stores
at which the x86 backend switches from an expanded inline memcpy to a real
memcpy. It would be better to use the real memcpy threshold from the backend,
but it's not available via TargetData.

This change brings the performance of c-ray in line with gcc 4.7. The included
test case tries to reproduce the c-ray problem to catch regressions for this
benchmark early, its performance is dominated by the inline decision of a
specific call.

This only has a small impact on most code, more on x86 and arm than on x86_64
due to the way the ABI works. When building LLVM for x86 it gives a small
inline cost boost to virtually any function using StringRef or STL allocators,
but only a 0.01% increase in overall binary size. The size of gcc compiled by
clang actually shrunk by a couple bytes with this patch applied, but not
significantly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161413 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-07 11:13:19 +00:00
..
2003-09-14-InlineValue.ll Update to new EH scheme. 2011-09-01 01:08:21 +00:00
2003-09-22-PHINodeInlineFail.ll
2003-09-22-PHINodesInExceptionDest.ll Update to new EH scheme. 2011-09-01 01:08:21 +00:00
2003-09-22-PHINodesInNormalInvokeDest.ll
2003-10-13-AllocaDominanceProblem.ll
2004-04-15-InlineDeletesCall.ll Replace more uses of 'unwind' in the tests with calls to landingpad and 2011-09-19 22:11:35 +00:00
2004-04-20-InlineLinkOnce.ll
2004-10-17-InlineFunctionWithoutReturn.ll Replace more uses of 'unwind' in the tests with calls to landingpad and 2011-09-19 22:11:35 +00:00
2006-01-14-CallGraphUpdate.ll
2006-07-12-InlinePruneCGUpdate.ll
2006-11-09-InlineCGUpdate-2.ll Replace more uses of 'unwind' in the tests with calls to landingpad and 2011-09-19 22:11:35 +00:00
2006-11-09-InlineCGUpdate.ll Replace more uses of 'unwind' in the tests with calls to landingpad and 2011-09-19 22:11:35 +00:00
2007-04-15-InlineEH.ll Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
2007-06-25-WeakInline.ll
2007-12-19-InlineNoUnwind.ll Try to eliminate the use of the 'unwind' instruction. 2011-09-02 22:41:11 +00:00
2008-09-02-NoInline.ll
2009-01-08-NoInlineDynamicAlloca.ll
2009-01-13-RecursiveInlineCrash.ll
2009-05-07-CallUsingSelfCrash.ll
2010-05-12-ValueMap.ll Actually run the test. Thanks Daniel Dunbar! 2010-05-13 17:41:06 +00:00
2010-05-31-ByvalTailcall.ll Fix PR7272: when inlining through a callsite with byval arguments, 2010-05-31 21:00:26 +00:00
alloca_test.ll
alloca-bonus.ll Initial commit for the rewrite of the inline cost analysis to operate 2012-03-31 12:42:41 +00:00
alloca-in-scc.ll
always-inline.ll Add some more testing to cover the remaining two cases where 2012-04-01 10:36:17 +00:00
array_merge.ll Commit test change, forgotten as part of r131838. 2011-05-22 05:31:47 +00:00
basictest.ll relax testcase a bit. 2011-01-14 07:46:33 +00:00
blockaddress.ll Remap blockaddress correctly when inlining a function. Fixes PR10162. 2011-10-21 20:45:19 +00:00
byval.ll when eliding a byval copy due to inlining a readonly function, we have 2010-12-20 08:10:40 +00:00
callgraph-update.ll Update to new EH scheme. 2011-09-01 01:08:21 +00:00
casts.ll Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
cfg_preserve_test.ll
crash2.ll add a DEBUG call so that -debug lists when CGSCCPM iterates. 2010-04-22 20:42:33 +00:00
crash.ll Update to new EH scheme. 2011-09-01 01:08:21 +00:00
delete-call.ll Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
devirtualize-2.ll rename test 2010-05-01 06:34:13 +00:00
devirtualize-3.ll Make BasicAliasAnalysis a normal AliasAnalysis implementation which 2010-10-18 18:04:47 +00:00
devirtualize.ll Make BasicAliasAnalysis a normal AliasAnalysis implementation which 2010-10-18 18:04:47 +00:00
dynamic_alloca_test.ll Initial commit for the rewrite of the inline cost analysis to operate 2012-03-31 12:42:41 +00:00
externally_available.ll Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
gvn-inline-iteration.ll Make BasicAliasAnalysis a normal AliasAnalysis implementation which 2010-10-18 18:04:47 +00:00
inline_cleanup.ll Sink the collection of return instructions until after *all* 2012-04-06 17:21:31 +00:00
inline_constprop.ll Fix PR13412, a nasty miscompile due to the interleaved 2012-08-07 10:59:59 +00:00
inline_dce.ll
inline_invoke.ll Update to new EH scheme. 2011-09-02 01:25:11 +00:00
inline_prune.ll Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
inline_returns_twice.ll Allow inlining of functions with returns_twice calls, if they have the 2011-12-18 20:35:43 +00:00
inline-byval-bonus.ll PR13095: Give an inline cost bonus to functions using byval arguments. 2012-08-07 11:13:19 +00:00
inline-invoke-tail.ll Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
inline-optsize.ll Fix the inliner so that the optsize function attribute don't alter the 2012-05-23 13:42:57 +00:00
inline-tail.ll
invoke_test-1.ll Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
invoke_test-2.ll Update to new EH scheme. 2011-09-01 01:08:21 +00:00
invoke_test-3.ll Update to new EH scheme. 2011-09-01 01:08:21 +00:00
lifetime.ll Teach the inliner to emit llvm.lifetime.start/end, to scope the local variables 2011-05-22 05:22:10 +00:00
lit.local.cfg Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed. 2012-02-16 06:28:33 +00:00
nested-inline.ll
noinline-recursive-fn.ll Initial commit for the rewrite of the inline cost analysis to operate 2012-03-31 12:42:41 +00:00
noinline.ll Reapply r99451 with a fix to move the NoInline check to the cost functions 2010-03-25 04:49:10 +00:00
PR4909.ll
ptr-diff.ll Initial commit for the rewrite of the inline cost analysis to operate 2012-03-31 12:42:41 +00:00