This is an archive of the discontinued LLVM Phabricator instance.

Move imported entities into DwarfCompilationUnit to speed up LTO linking.
ClosedPublic

Authored by krasin on Oct 20 2015, 2:59 PM.

Diff Detail

Event Timeline

krasin updated this revision to Diff 37930.Oct 20 2015, 2:59 PM
krasin retitled this revision from to Lazily sort ScopesWithImportedEntities to speed up LTO linking..
krasin updated this object.
krasin abandoned this revision.Oct 20 2015, 2:59 PM
krasin updated this revision to Diff 37934.Oct 20 2015, 3:03 PM
  • Remove leftovers
krasin updated this revision to Diff 38057.Oct 21 2015, 3:39 PM

NOT FOR SUBMIT: verification code with old and new approaches.

krasin updated this revision to Diff 38137.Oct 22 2015, 9:12 AM

Reduce the diff

krasin updated this revision to Diff 38139.Oct 22 2015, 9:16 AM

Diff is even smaller

krasin updated this revision to Diff 38149.Oct 22 2015, 11:35 AM

Now, it's only new code. Correct, but not fully optimized for speed yet.

krasin updated this revision to Diff 38153.Oct 22 2015, 11:49 AM

Use DenseMap.

krasin retitled this revision from Lazily sort ScopesWithImportedEntities to speed up LTO linking. to Move imported entities into DwarfCompilationUnit to speed up LTO linking..Oct 22 2015, 11:50 AM
krasin updated this object.
krasin added a reviewer: dblaikie.
dblaikie accepted this revision.Oct 22 2015, 11:59 AM
dblaikie edited edge metadata.

Looks great - thanks for your patience/perseverance on this. I think the net result is a better design & better performance.

Please commit whenever you're ready (couple of optional brace issues, but nothing else to worry about).

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
348–360

You could drop the braces on the single-statement loop (as with the original code) - some people prefer to have them for multiline blocks, even if it's a single statement.

353

This verification code looks good to me - so if that's passing when running over a large project like Chrome, I'm happy enough that this is doing the right thing.

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
495

drop the braces on a single-line block (matches the code that follows)

This revision is now accepted and ready to land.Oct 22 2015, 11:59 AM
krasin updated this revision to Diff 38262.Oct 23 2015, 2:10 PM
krasin updated this object.
krasin edited edge metadata.

sync

krasin updated this revision to Diff 38263.Oct 23 2015, 2:13 PM
  • Remove unnecessary braces
krasin marked 2 inline comments as done.Oct 23 2015, 2:16 PM

I am running last checks and will submit after that.
This variant is actually slower than the initial one. I have measured 65 minutes for linking the official Chrome with LTO and CFI versus 55 minutes originally.
I have a feeling that there's something could be done about that. Moving the logic into DwarfCompilationUnit is unlikely to be the reason for the slowdown.

krasin closed this revision.Oct 26 2015, 2:38 PM