This is an archive of the discontinued LLVM Phabricator instance.

[DebugInstrRef] Memoize variable order during sorting (NFC)
ClosedPublic

Authored by nikic on Jan 18 2022, 9:34 AM.

Details

Summary

Instead of constructing DebugVariables and looking up the order in the comparison function, compute the order upfront and then sort a vector of (order, instr).

This improves compile-time: http://llvm-compile-time-tracker.com/compare.php?from=0d51b6ab1587a5d5d649cc5c1a9bc9e7e6d8de2c&to=c2d367208d3e1fc4fb0f1281efe3145e22bcc2ad&stat=instructions

Diff Detail

Event Timeline

nikic created this revision.Jan 18 2022, 9:34 AM
nikic requested review of this revision.Jan 18 2022, 9:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2022, 9:34 AM
jmorse accepted this revision.Jan 20 2022, 6:13 AM

LGTM, thanks for find this!

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
2814

nit, "appear"

This revision is now accepted and ready to land.Jan 20 2022, 6:13 AM
This revision was landed with ongoing or failed builds.Jan 20 2022, 7:04 AM
This revision was automatically updated to reflect the committed changes.