[llvm-branch-commits] [llvm-branch] r88930 - /llvm/branches/Apple/Leela/lib/CodeGen/PHIElimination.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Nov 16 10:12:10 PST 2009


Author: stoklund
Date: Mon Nov 16 12:12:09 2009
New Revision: 88930

URL: http://llvm.org/viewvc/llvm-project?rev=88930&view=rev
Log:
Merge r88880.

Lang's fix to my PHIElimination bug.


Modified:
    llvm/branches/Apple/Leela/lib/CodeGen/PHIElimination.cpp

Modified: llvm/branches/Apple/Leela/lib/CodeGen/PHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/PHIElimination.cpp?rev=88930&r1=88929&r2=88930&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/PHIElimination.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/PHIElimination.cpp Mon Nov 16 12:12:09 2009
@@ -141,10 +141,10 @@
   if (!SuccMBB.isLandingPad())
     return MBB.getFirstTerminator();
 
-  // Discover any definitions in this basic block.
+  // Discover any defs/uses in this basic block.
   SmallPtrSet<MachineInstr*, 8> DefUsesInMBB;
-  for (MachineRegisterInfo::def_iterator RI = MRI->def_begin(SrcReg),
-         RE = MRI->def_end(); RI != RE; ++RI) {
+  for (MachineRegisterInfo::reg_iterator RI = MRI->reg_begin(SrcReg),
+         RE = MRI->reg_end(); RI != RE; ++RI) {
     MachineInstr *DefUseMI = &*RI;
     if (DefUseMI->getParent() == &MBB)
       DefUsesInMBB.insert(DefUseMI);
@@ -155,11 +155,11 @@
     // No defs.  Insert the copy at the start of the basic block.
     InsertPoint = MBB.begin();
   } else if (DefUsesInMBB.size() == 1) {
-    // Insert the copy immediately after the def.
+    // Insert the copy immediately after the def/use.
     InsertPoint = *DefUsesInMBB.begin();
     ++InsertPoint;
   } else {
-    // Insert the copy immediately after the last def.
+    // Insert the copy immediately after the last def/use.
     InsertPoint = MBB.end();
     while (!DefUsesInMBB.count(&*--InsertPoint)) {}
     ++InsertPoint;





More information about the llvm-branch-commits mailing list