[PATCH] D15779: [ELF] - Implemented optimization for R_X86_64_GOTPCREL relocation.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 06:04:40 PST 2016


> Currently relocations are applied and optimized in a single pass. It would
> be great if we can split it into two passes, assuming that (1) there's not
> much code duplication between the two passes, and (2) that doesn't increase
> link time that much.

Current situation is actually worse than that. We have to split the
code in decision making and application, but the decision making is
run twice, once to find if the optimization impacts things like got
size and again to decide if we should actually optimize.



> I believe (1) is not really a concern because the first
> pass focuses only on code relaxation and the second on relocation
> application, so their work doesn't overlap, therefore there should not be
> that much code duplication. As to (2), I'd expect that the performance
> impact would be fairly small from my experience to write markLive() function
> which visits all relocations.
>
> Overall, I think it's worth a shot.
>
> I don't like to see many more code relaxations because it makes code
> refactoring harder. Fortunately, code relaxation is an optional
> optimization, so you don't have to do that, so we can suspend that for now.

Cheers,
Rafael


More information about the llvm-commits mailing list