[AVR] Optimize 32-bit shifts: optimize REG_SEQUENCE
authorAyke van Laethem <aykevanlaethem@gmail.com>
Tue, 6 Dec 2022 13:47:31 +0000 (14:47 +0100)
committerAyke van Laethem <aykevanlaethem@gmail.com>
Sun, 8 Jan 2023 19:05:31 +0000 (20:05 +0100)
commit9592920890cf7c13d5a47e54d62284e7bd1418cf
tree2a5060b35886455f4264a60cc13422544768e6c6
parentfad5e0cf50f119f083dfc82e08994825cae5001f
[AVR] Optimize 32-bit shifts: optimize REG_SEQUENCE

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.

Differential Revision: https://reviews.llvm.org/D140573
llvm/lib/Target/AVR/AVRISelLowering.cpp
llvm/test/CodeGen/AVR/shift32.ll