This is an archive of the discontinued LLVM Phabricator instance.

[BOLT][DWARF] Output DWO files as they are being processed
ClosedPublic

Authored by ayermolo on Jun 1 2023, 10:33 AM.

Details

Summary

Changed how we handle writing out .dwo and .dwp files. We now write out DWO
sections sooner and destroy DIEBuilder. This should decrease memory footprint.

Ran on clang-17 build in debug mode with split-dwarf.
before
8:07.49 real, 664.62 user, 69.00 sys, 0 amem, 41601612 mmem
8:07.06 real, 669.60 user, 68.75 sys, 0 amem, 41822588 mmem
8:00.36 real, 664.14 user, 66.36 sys, 0 amem, 41561548 mmem

after
8:21.85 real, 682.23 user, 69.64 sys, 0 amem, 39379880 mmem
8:04.58 real, 671.62 user, 66.50 sys, 0 amem, 39735800 mmem
8:10.02 real, 680.67 user, 67.24 sys, 0 amem, 39662888 mmem

Depends on D151906

Diff Detail

Event Timeline

ayermolo created this revision.Jun 1 2023, 10:33 AM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
ayermolo requested review of this revision.Jun 1 2023, 10:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2023, 10:33 AM
maksfb added inline comments.Jun 22 2023, 2:49 PM
bolt/lib/Rewrite/DWARFRewriter.cpp
307

Do we ever invoke this function with a null NameToIndexMap?

362
1526

Assert that RangeListsWriter is non-null, or use a reference.

1607
1608

Do we need to assert that the section is non-null?

1619
2000

nit: remove curly braces.

ayermolo marked 7 inline comments as done.Jun 23 2023, 10:45 AM
ayermolo added inline comments.
bolt/lib/Rewrite/DWARFRewriter.cpp
307

Not anymore, it looks like.

1608

I guess in theory there might not be a str section somehow? Added just in case.

ayermolo updated this revision to Diff 534012.Jun 23 2023, 10:46 AM
ayermolo marked 2 inline comments as done.

addressed comments

maksfb accepted this revision.Jul 6 2023, 11:56 AM

LGTM

This revision is now accepted and ready to land.Jul 6 2023, 11:56 AM
ayermolo closed this revision.Jul 6 2023, 4:59 PM
ayermolo reopened this revision.Jul 7 2023, 4:56 PM
This revision is now accepted and ready to land.Jul 7 2023, 4:56 PM
This revision was landed with ongoing or failed builds.Jul 10 2023, 2:42 PM
This revision was automatically updated to reflect the committed changes.