[llvm] [CodeGen][AMDGPU] TwoAddress: Only skip undef COPY at REG_SEQUENCE lowering when there is Live info or no uses for subreg (PR #175598)

Felipe Quezada via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 05:54:34 PST 2026


================
@@ -2006,16 +2006,33 @@ void TwoAddressInstructionImpl::eliminateRegSequence(
     }
   }
 
+  // If there are no live intervals information, we scan the use list once
+  // in order to find which subregisters are used.
+  LaneBitmask UsedLanes = LaneBitmask::getNone();
+  if (!LIS) {
+    for (MachineOperand &Use : MRI->use_nodbg_operands(DstReg)) {
+      unsigned SubReg = Use.getSubReg();
----------------
kezada94 wrote:

Thanks, I've updated the code.

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


More information about the llvm-commits mailing list