[llvm] [CodeGen] Delete mov from imul sequence by allowing rm form (PR #190304)

Takashi Idobe via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 06:18:41 PDT 2026


================
@@ -1148,10 +1148,28 @@ bool TwoAddressInstructionImpl::rescheduleKillAboveMI(
   } else {
     KillMI = LV->getVarInfo(Reg).findKill(MBB);
   }
-  if (!KillMI || MI == KillMI || KillMI->isCopy() || KillMI->isCopyLike())
-    // Don't mess with copies, they may be coalesced later.
+  if (!KillMI || MI == KillMI)
     return false;
 
+  bool IsCopyKill = KillMI->isCopy() || KillMI->isCopyLike();
----------------
Takashiidobe wrote:

this isCopy() check is redundant cause isCopyLike() includes isCopy() + isSubRegToReg(). I've removed that check and added some MIR tests for the copy + subreg to reg case.

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


More information about the llvm-commits mailing list