[AVR] Set R31R30 as clobbered after ADJCALLSTACKDOWN
In most cases, using R31R30 is fine because the call (which always precedes ADJCALLSTACKDOWN) will clobber R31R30 anyway. However, in some rare cases the register allocator might insert an instruction between the call and the ADJCALLSTACKDOWN instruction and expect the register pair to be live afterwards. I think this happens as a result of rematerialization. Therefore, to fix this, the instruction needs to have Defs set to R31R30. Setting the Defs field does have the effect of making the instruction look dead, which it certainly is not. This is fixed by setting hasSideEffects to true. Differential Revision: https://reviews.llvm.org/D97745
Loading
Please sign in to comment