This is an archive of the discontinued LLVM Phabricator instance.

Create thunks before regular relocation scan
ClosedPublic

Authored by rafael on Jul 20 2016, 8:45 AM.

Details

Reviewers
ruiu
Summary

We will need to do something like this to support range extension
thunks since that process is iterative.

Doing this also has the advantage that when doing the regular
relocation scan the offset in the output section is known and we can
just store that. This reduces the number of times we have to run
getOffset and I think will allow a more specialized .eh_frame
representation.

By itself this is already a performance win.

firefox

master 7.295045737
patch  7.209466989 0.98826892235

chromium

master 4.531254468
patch  4.509221804 0.995137623774

chromium fast

master 1.836928973
patch  1.823805241 0.992855612714

the gold plugin

master 0.379768791
patch  0.380043405 1.00072310839

clang

master 0.642698284
patch  0.642215663 0.999249070657

llvm-as

master 0.036665467
patch  0.036456225 0.994293213284

the gold plugin fsds

master 0.40395817
patch  0.404384555 1.0010555177

clang fsds

master 0.722045545
patch  0.720946135 0.998477367518

llvm-as fsds

master 0.03292646
patch  0.032759965 0.994943428477

scylla

master 3.427376378
patch  3.368316181 0.98276810292

Cheers,
Rafael

Diff Detail

Event Timeline

rafael updated this revision to Diff 64698.Jul 20 2016, 8:45 AM
rafael retitled this revision from to Create thunks before regular relocation scan.
rafael updated this object.
rafael added a reviewer: ruiu.
rafael added a subscriber: llvm-commits.
ruiu accepted this revision.Jul 20 2016, 8:55 AM
ruiu edited edge metadata.

LGTM

ELF/Relocations.cpp
552

Please add a comment for this block of code.

557

You don't need ().

693

RI is short for relocation iterator, so Rel would be a better name.

This revision is now accepted and ready to land.Jul 20 2016, 8:55 AM
emaste added a subscriber: emaste.Jul 20 2016, 9:06 AM

Looks good to me too. I think splitting out thunk creation is the right thing to do.

Range extension thunks are likely to need some changes in order as the generation of any content by scanRelocations could in theory affect the decision on whether a range extension thunk is needed. However that is best resolved at the time range extension thunks are implemented.

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r276146.