In most cases, using R31R30 is fine because the call (which always
precedes ADJCALLSTACKUP) will clobber R31R30 anyway. However, in some
rare cases the register allocator might insert an instruction between
the call and the ADJCALLSTACKUP 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.
Note that I can only reproduce the bug on a special branch that I'm working on. Maybe it is reproduce outside that branch with some effort. However, because it looks like a potential bug (and because it fixes a TODO) I've decided to create a patch to fix this anyway.