[PATCH] D41770: Rewrite our relocation processing

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 13:31:55 PST 2018

Rafael Avila de Espindola via Phabricator <reviews at reviews.llvm.org>

> espindola created this revision.
> espindola added reviewers: ruiu, grimar, atanasyan, smeenai.
> Herald added subscribers: arichardson, javed.absar, sdardis, emaste.
> This splits relocation processing in two steps.
> First, analyze what needs to be done at the relocation spot. This can be a constant (non preemptible symbol, relative got reference, etc) or require a dynamic relocation. At this step we also consider creating copy relocations.
> Once that is done we decide if we need a got or a plt entry.
> The code is simpler IMHO. For example:
> - There is a single call to isPicRel since the logic is not split among adjustExpr and the caller.
> - R_MIPS_GOTREL is simple to handle now.
> - The tracking of what is preemptible or not is much simpler now.
> This also fixes a regression with symbols being both in a got and copy relocated. They had regressed in r268668 and r268149.
> The other test changes are because of error messages changes or the order of two relocations in the output.
> I will benchmark and report.

I benchmarked the combination off all current refactoring patches.

Overall it is an improvement (-0.70% geometric mean). The one big
exception is the linux kernel which is now 4% slower. The slowdown seems
be be because of more mispredicted branches.

Given that this does include a bug fix and overall it is an improvement,
I think it makes sense to move forward.

Once all patches are in I intend to benchmark them independently and try
to figure out what causes a higher mispredict when linking the kernel.


More information about the llvm-commits mailing list