[PATCH] D16468: [ELF] - Attempt to simplificate the relocations relaxation code
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 22 09:56:02 PST 2016
grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
This patch introduces the next changes:
1) During Writer<ELFT>::scanRelocs() marks and remembers for each relocation if it can be optimized(relaxed) or not.
2) In following code remembered values are used. (RelocationSection<ELFT>::writeTo() is not covered yet, it is possible to make it use remembered values also, If this patch will be ok, I`ll do that).
3) InputSectionBase<ELFT>::relocate() is split to relocateNotOptimized and relocateOptimized. So relaxations are handled separately what also simplified the code.
All above allowed to significantly reduce amount excessive isTlsOptimized calls (after fixing p2 which has one, the only places will be in Target class, what is fine and expected I believe).
I introduced
```
struct RelocData {
bool Optimized = false;
};
```
struct for each relocation data, but It looks single boolean is enought now and I can replace the struct with single bool. Not sure will we need to remember any other data for relocations ?
http://reviews.llvm.org/D16468
Files:
ELF/InputFiles.cpp
ELF/InputSection.cpp
ELF/InputSection.h
ELF/MarkLive.cpp
ELF/OutputSections.cpp
ELF/Writer.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16468.45694.patch
Type: text/x-patch
Size: 16132 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160122/08ea7b70/attachment-0001.bin>
More information about the llvm-commits
mailing list