[llvm-commits] [llvm] r54422 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp

Owen Anderson resistor at mac.com
Wed Aug 6 13:29:21 PDT 2008


Author: resistor
Date: Wed Aug  6 15:29:20 2008
New Revision: 54422

URL: http://llvm.org/viewvc/llvm-project?rev=54422&view=rev
Log:
We don't need to try to coalesce input vregs that are the same as the output vreg.

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

Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=54422&r1=54421&r2=54422&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Wed Aug  6 15:29:20 2008
@@ -421,6 +421,7 @@
   while (P != MBB->end() && P->getOpcode() == TargetInstrInfo::PHI) {
     unsigned DestReg = P->getOperand(0).getReg();
 
+    
     // Don't both doing PHI elimination for dead PHI's.
     if (P->registerDefIsDead(DestReg)) {
       ++P;
@@ -442,6 +443,12 @@
     // Iterate over the operands of the PHI node
     for (int i = P->getNumOperands() - 1; i >= 2; i-=2) {
       unsigned SrcReg = P->getOperand(i-1).getReg();
+      
+      // Don't need to try to coalesce a register with itself.
+      if (SrcReg == DestReg) {
+        ProcessedNames.insert(SrcReg);
+        continue;
+      }
     
       // Check for trivial interferences via liveness information, allowing us
       // to avoid extra work later.  Any registers that interfere cannot both





More information about the llvm-commits mailing list