This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Optimize 32-bit shifts: optimize REG_SEQUENCE
ClosedPublic

Authored by aykevl on Dec 22 2022, 11:23 AM.

Details

Summary

This pseudo-instruction stores two small (8-bit) registers into one wide (16-bit) register. But apparently the order matters a lot to the
register allocator.
This patch changes the order of inserting the registers to optimize for the best register allocation in the tests of shift32.ll. It might be detrimental in other cases, but keeping the registers in the same physical register seems like it would be a common case.

Diff Detail

Event Timeline

aykevl created this revision.Dec 22 2022, 11:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2022, 11:23 AM
Herald added subscribers: Jim, hiraditya. · View Herald Transcript
aykevl requested review of this revision.Dec 22 2022, 11:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2022, 11:23 AM
benshi001 accepted this revision.Dec 23 2022, 5:39 AM

LGTM. Thanks!

This revision is now accepted and ready to land.Dec 23 2022, 5:39 AM
This revision was landed with ongoing or failed builds.Jan 8 2023, 11:06 AM
This revision was automatically updated to reflect the committed changes.