[llvm] [AMDGPU] Post-RA Peephole for Two-Address Instructions (PR #207731)

Carl Ritson via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 02:15:00 PDT 2026


================
@@ -763,13 +795,105 @@ MachineInstrBuilder SIPreEmitPeephole::createUnpackedMI(MachineInstr &I,
   return NewMI;
 }
 
+std::optional<Register> SIPreEmitPeephole::checkCopy(MachineInstr &TwoAddress,
+                                                     MachineInstr &MaybeCopy,
+                                                     Register Src) {
+  if (MaybeCopy.isBundle())
+    return std::nullopt;
+
+  switch (MaybeCopy.getOpcode()) {
+  case AMDGPU::COPY:
+  case AMDGPU::V_MOV_B32_e32:
----------------
perlfu wrote:

I suspect in general there could be other opcodes here?

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


More information about the llvm-commits mailing list