This is an archive of the discontinued LLVM Phabricator instance.

Switch a std::map to a DenseMap in CodeGenRegisters
ClosedPublic

Authored by resistor on Feb 10 2015, 2:02 PM.

Details

Summary

As far as I can tell, the keys of the map are unique by pointer address, so there's no need to use the llvm::less comparator. This allows us to use DenseMap instead, which reduces tblgen time by 20% on my stress test.

Diff Detail

Repository
rL LLVM

Event Timeline

resistor updated this revision to Diff 19709.Feb 10 2015, 2:02 PM
resistor retitled this revision from to Switch a std::map to a DenseMap in CodeGenRegisters.
resistor updated this object.
resistor edited the test plan for this revision. (Show Details)
resistor added reviewers: chandlerc, mehdi_amini.
resistor set the repository for this revision to rL LLVM.
resistor added a subscriber: Unknown Object (MLST).
resistor updated this revision to Diff 20095.Feb 17 2015, 9:47 AM

Added checking of uniqueness to one loop that would potentially change iteration order here. I'd prefer *not* to add checking to computeSubRegs() in CodeGenRegisters.cpp because the checking would be quite heavyweight, the method is very hot, and I am explicitly trying to improve LLVM build times in Release+Asserts configs here.

resistor accepted this revision.Feb 27 2015, 9:59 AM
resistor added a reviewer: resistor.
This revision is now accepted and ready to land.Feb 27 2015, 9:59 AM
resistor closed this revision.Feb 27 2015, 9:59 AM

r230769