mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-08 03:30:22 +00:00
b6fdd022b7
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 |
||
---|---|---|
.. | ||
2003-09-14-InlineValue.ll | ||
2003-09-22-PHINodeInlineFail.ll | ||
2003-09-22-PHINodesInExceptionDest.ll | ||
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 | ||
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 | ||
2009-01-13-RecursiveInlineCrash.ll | ||
2009-05-07-CallUsingSelfCrash.ll | ||
2010-05-12-ValueMap.ll | ||
2010-05-31-ByvalTailcall.ll | ||
alloca_test.ll | ||
alloca-bonus.ll | ||
alloca-in-scc.ll | ||
always-inline.ll | ||
array_merge.ll | ||
basictest.ll | ||
blockaddress.ll | ||
byval.ll | ||
callgraph-update.ll | ||
casts.ll | ||
cfg_preserve_test.ll | ||
crash2.ll | ||
crash.ll | ||
delete-call.ll | ||
devirtualize-2.ll | ||
devirtualize-3.ll | ||
devirtualize.ll | ||
dynamic_alloca_test.ll | ||
externally_available.ll | ||
gvn-inline-iteration.ll | ||
inline_cleanup.ll | ||
inline_constprop.ll | ||
inline_dce.ll | ||
inline_invoke.ll | ||
inline_prune.ll | ||
inline_returns_twice.ll | ||
inline-byval-bonus.ll | ||
inline-invoke-tail.ll | ||
inline-optsize.ll | ||
inline-tail.ll | ||
invoke_test-1.ll | ||
invoke_test-2.ll | ||
invoke_test-3.ll | ||
lifetime.ll | ||
lit.local.cfg | ||
nested-inline.ll | ||
noinline-recursive-fn.ll | ||
noinline.ll | ||
PR4909.ll | ||
ptr-diff.ll |