These can't be reasonably matched in tablegen due to the handling of
flags, so we have to do this in C++ code. We only did it for inc and
dec historically, this starts fleshing that out to more interesting
instructions. Notably, this handles transfering operands to add and
sub.
Currently this forces them into a register. The next patch will add
support for keeping immediate operands as immediates. Then I'll extend
this beyond just add and sub.
I'm not super thrilled by the repeated switches in the code but
everything else I tried was really ugly or problematic.
Many thanks to Craig Topper for the suggestions about where to even
begin here and how to make this stuff work.