This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] ICF: Do more work in equalsConstant, less in equalsVariable
ClosedPublic

Authored by int3 on Jul 16 2021, 11:41 PM.

Details

Summary

In particular, relocations to absolute symbols or literal sections can
be handled in equalsConstant(), since their output addresses will not
change across each iteration of ICF. Offsets and addends can also be
dealt with entirely in equalsConstant(), making the code somewhat easier
to reason about. Only ConcatInputSections need to be handled in
equalsVariable().

LLD-ELF's implementation takes a similar approach.

Although this should make ICF do less work, in practice it seems like
there is no stat sig difference in time taken when linking
chromium_framework.

This refactor is motivated by an upcoming diff which improves ICF's handling of
addends.

Diff Detail

Event Timeline

int3 created this revision.Jul 16 2021, 11:41 PM
Herald added a project: Restricted Project. · View Herald Transcript
int3 requested review of this revision.Jul 16 2021, 11:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2021, 11:41 PM
gkm accepted this revision.Jul 22 2021, 1:29 PM

Bueno!

This revision is now accepted and ready to land.Jul 22 2021, 1:29 PM
This revision was landed with ongoing or failed builds.Jul 23 2021, 8:49 AM
This revision was automatically updated to reflect the committed changes.