[llvm-commits] [llvm] r80630 - /llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp

Bob Wilson bob.wilson at apple.com
Mon Aug 31 14:54:16 PDT 2009


Author: bwilson
Date: Mon Aug 31 16:54:16 2009
New Revision: 80630

URL: http://llvm.org/viewvc/llvm-project?rev=80630&view=rev
Log:
If the tied registers are already the same, there is no need to change
them.  Move the code to make that change inside the conditional.

Modified:
    llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp

Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=80630&r1=80629&r2=80630&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon Aug 31 16:54:16 2009
@@ -985,13 +985,13 @@
                 mi->getOperand(i).getReg() == regB)
               mi->getOperand(i).setReg(regA);
           }
-        }
 
-        assert(mi->getOperand(ti).isDef() && mi->getOperand(si).isUse());
-        mi->getOperand(ti).setReg(mi->getOperand(si).getReg());
-        MadeChange = true;
+          assert(mi->getOperand(ti).isDef() && mi->getOperand(si).isUse());
+          mi->getOperand(ti).setReg(mi->getOperand(si).getReg());
+          MadeChange = true;
 
-        DEBUG(errs() << "\t\trewrite to:\t" << *mi);
+          DEBUG(errs() << "\t\trewrite to:\t" << *mi);
+        }
       }
 
       mi = nmi;





More information about the llvm-commits mailing list