[llvm] [TII][NFC] Add renamable bit to copyPhysReg (PR #91179)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 10:13:22 PDT 2024


topperc wrote:

> > Instead of making this NFC could you plumb through the added arguments?
> > Unless I'm missing something this patch puts us in a world where we describe what we want wrt renamable but nothing happens.
> 
> This patch will be utilized by [#89865](https://github.com/llvm/llvm-project/pull/89865). An example was found where redundant COPY instructions were emitted in the final assembly, which was expected to be handled by the MachineCopyPropagation pass. However, the MachineCopyPropagation pass failed to catch the pattern due to the lack of a renamable flag. This issue arose because the pseudo expand pass did not inherit the renamable flag from the COPY instruction. By ensuring that copyPhysReg can correctly propagate the renamable flag, the MachineCopyPropagation pass can catch and remove such redundant COPY instructions.

#89865 should be focused on the change needed in MachineCopyPropagation.cpp. The changed needed in RISCVInstrInfo::copyPhysReg could be in this patch with its own MIR test.

https://github.com/llvm/llvm-project/pull/91179


More information about the llvm-commits mailing list