[llvm] [AMDGPU] remove move instruction if there is no user of it (PR #136735)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue May 6 06:31:22 PDT 2025


================
@@ -797,7 +797,7 @@ MachineInstr *SIShrinkInstructions::matchSwap(MachineInstr &MovT) const {
     dropInstructionKeepingImpDefs(*MovY);
     MachineInstr *Next = &*std::next(MovT.getIterator());
 
-    if (T.isVirtual() && MRI->use_nodbg_empty(T)) {
+    if (MRI->use_nodbg_empty(T)) {
----------------
jayfoad wrote:

I agree - as far as I can see, the use list for physical registers does not include any aliasing registers, so the committed patch is not safe and should be reverted.

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


More information about the llvm-commits mailing list