The register allocator can select a different register for the destination even if both operands are killed by the instruction. Here’s the RISC-V patch where I copied SystemZ code to give hints to the register allocator about making source and dest the same. ⚙ D138242 [RISCV] Use register allocation hints to improve use of compressed instructions.
1 Like