This is an archive of the discontinued LLVM Phabricator instance.

ELF: Move section merging before ICF. NFCI.
ClosedPublic

Authored by pcc on Jun 11 2017, 4:08 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Jun 11 2017, 4:08 PM
ruiu added inline comments.Jun 11 2017, 4:29 PM
lld/ELF/Driver.cpp
1007–1008 ↗(On Diff #102141)

I first read this comment as markLive does all these things. I guess this comment describes all the code until writeResult. This is a bit confusing.

1020–1021 ↗(On Diff #102141)

Should we move this to mergeSections?

pcc added inline comments.Jun 11 2017, 4:38 PM
lld/ELF/Driver.cpp
1020–1021 ↗(On Diff #102141)

Seems reasonable. It'll need to be called something like decompressAndMergeSections, but that's probably fine.

pcc updated this revision to Diff 102143.Jun 11 2017, 4:47 PM
  • Address review comments
pcc marked 2 inline comments as done.Jun 11 2017, 4:47 PM
pcc added inline comments.
lld/ELF/Driver.cpp
1007–1008 ↗(On Diff #102141)

Okay, now all the size optimizations are in one block like before.

ruiu accepted this revision.Jun 11 2017, 4:50 PM

LGTM

lld/ELF/Driver.cpp
1003 ↗(On Diff #102143)

Can you add a comment saying that this adds a .comment section containing a version string, and we have to do that before mergeSections because the .comment section is a mergeable section?

This revision is now accepted and ready to land.Jun 11 2017, 4:50 PM
This revision was automatically updated to reflect the committed changes.
pcc marked an inline comment as done.