This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Simplify readAddressArea() implementation.
ClosedPublic

Authored by grimar on May 15 2017, 3:11 AM.

Details

Summary

Approach significantly simplifies LLD .gdb_index code and makes it much faster.
Also it should resolve issues, like D33176 tries to address once and forever in a clean way.

LLC binary linking without patch and without --gdb-index: 1,599241063
LLC binary linking without patch and with --gdb-index: 6,064316262
LLC binary linking with patch and with --gdb-index: 4,116792104

Time spent for building gdbindex changes from (6,064316262 - 1,599241063 == 4,465075199)
to (4,116792104- 1,599241063 == 2,517551041).
That is 2,517551041/4,465075199 = 0,564 or about 44% speedup.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.May 15 2017, 3:11 AM
grimar edited the summary of this revision. (Show Details)May 15 2017, 8:13 AM
ruiu edited edge metadata.May 15 2017, 10:28 AM

This looks better, but how does it work? grep -w -r DWARFAddress . shows nothing in my LLVM repository.

D33184 was committed finally, so that should be ready to land. Rafael gave LGTM earlier. Rui do you have any objections or we can land it ?

Rui, could you look at this, please ?

ruiu accepted this revision.Jun 6 2017, 11:30 AM

LGTM

This revision is now accepted and ready to land.Jun 6 2017, 11:30 AM
grimar added a comment.Jun 7 2017, 3:47 AM

Rafael, Rui, thanks for review.

During rebasing it I faced with 2 more issues I did not expect to see (otherwise I would rebase it earlier before asking for final reviews).
Fortunately they seems to be minor so I am going to commit this with fixes for them.

  1. I had to add S->Live check. That is fine because was done by D33175 already, so I just added this check to support already existent case we support.
  2. I had to skip ranges which has R.LowPC == R.HighPC before adding them to index. That allows to pass testcase introduced by D33176. That change is consistent with gold

behavior and correct because DWARF manual says that: "A range list entry (but not a base address selection or end of list entry) whose beginning and
ending addresses are equal has no effect because the size of the range covered by such an entry is zero.". So there is no much sence to add
empty ranges to index and our previous logic already did not do that implicitly.

These two changes are consistent with current LLD behavior already and I hope fine.

This revision was automatically updated to reflect the committed changes.