This is an archive of the discontinued LLVM Phabricator instance.

[LV] Simplify register usage code and avoid double map lookups.
ClosedPublic

Authored by craig.topper on Oct 14 2022, 11:20 AM.

Details

Summary

Instead of checking whether a map entry exists to decide if we should
initialize it or add to it, we can rely on the map entry being constructed
and initialized to 0 before the addition happens.

For the std::max case, I've made a reference to the map entry to
avoid looking it up twice.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 14 2022, 11:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2022, 11:20 AM
craig.topper requested review of this revision.Oct 14 2022, 11:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2022, 11:20 AM
reames accepted this revision.Oct 14 2022, 11:43 AM

LGTM

Please tag title as nfc.

This revision is now accepted and ready to land.Oct 14 2022, 11:43 AM
This revision was landed with ongoing or failed builds.Oct 14 2022, 11:57 AM
This revision was automatically updated to reflect the committed changes.