wip patch: Create SymbolBody for all symbols

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 19:11:29 PST 2016


OK, looking at perf, what I got was that the "slow" instructions were


mov    (%rcx,%rax,8),%rax
mov    0x28(%rax),%rax
mov    (%rax),%r13

Which correspond to:
 * given a symbol index, get the SymbolBody*
 * get the backref
 * get the repl

I think these are only slow because we then proceed to use the data
and pref blames the instruction that is computing the dependency of an
expensive computations.

The slowdown is because previously for local symbols we would branch
out on the body being null.

This suggests possible speed improvements:
* Allocate SymbolBodies inline, like we do for SharedFile.
* Use a bit of the pointer to cache if the SymbolBody is local or not.

Given that there is a reasonable understanding, that other benchmarks
(scylla) actually got faster and that the slowdown is not inherently
because of the extra allocation, is the patch OK?

Cheers,
Rafael



On 9 March 2016 at 18:21, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> llvm.org/pr26878 has a case where we need to put a local symbol in the
> got. Given that we have to allocate something to remember the got
> index.
>
> One way to do it is to create SymbolBodies. The attached patch does it
> an has the potential of further simplifications.
>
> Unfortunately with it I am seeing a 1.09X slowdown when linking clang.
> The link line has --export-dynamic -O3 --gc-sections.
>
> Cheers,
> Rafael


More information about the llvm-commits mailing list