[llvm] [Codegen][Backend] Remove redundant pseudo mov instruction (PR #139716)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue May 13 05:52:11 PDT 2025


================
@@ -186,11 +186,13 @@ static bool isCandidate(const MachineInstr *MI, Register &DefedReg,
   for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
     const MachineOperand &MO = MI->getOperand(i);
     if (MO.isReg()) {
-      if (MO.isDef()) {
+      if (MO.isDef() && DefedReg == MCRegister::NoRegister) {
----------------
arsenm wrote:

Don't understand why this is necessary, in general this would be a malformed instruction 

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


More information about the llvm-commits mailing list