[llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp

Evan Cheng evan.cheng at apple.com
Thu Oct 12 01:01:01 PDT 2006



Changes in directory llvm/lib/CodeGen:

VirtRegMap.cpp updated: 1.74 -> 1.75
---
Log message:

Backing out Chris' last commit. It's breaking llvm-gcc bootstrapping.

It's turning:
        movl -24(%ebp), %esp
        subl $16, %esp
        movl -24(%ebp), %ecx
into
        movl -24(%ebp), %esp
        subl $16, %esp
        movl %esp, (%esp) 


---
Diffs of the changes:  (+17 -32)

 VirtRegMap.cpp |   49 +++++++++++++++++--------------------------------
 1 files changed, 17 insertions(+), 32 deletions(-)


Index: llvm/lib/CodeGen/VirtRegMap.cpp
diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.74 llvm/lib/CodeGen/VirtRegMap.cpp:1.75
--- llvm/lib/CodeGen/VirtRegMap.cpp:1.74	Wed Oct 11 21:34:07 2006
+++ llvm/lib/CodeGen/VirtRegMap.cpp	Thu Oct 12 03:00:47 2006
@@ -706,25 +706,24 @@
       if ((MR & VirtRegMap::isRef) && !(MR & VirtRegMap::isMod)) {
         int FrameIdx;
         if (unsigned DestReg = TII->isLoadFromStackSlot(&MI, FrameIdx)) {
-          if (FrameIdx == SS) {
-            // If this spill slot is available, turn it into a copy (or nothing)
-            // instead of leaving it as a load!
-            if (unsigned InReg = Spills.getSpillSlotPhysReg(SS)) {
-              DEBUG(std::cerr << "Promoted Load To Copy: " << MI);
-              MachineFunction &MF = *MBB.getParent();
-              if (DestReg != InReg) {
-                MRI->copyRegToReg(MBB, &MI, DestReg, InReg,
-                                  MF.getSSARegMap()->getRegClass(VirtReg));
-                // Revisit the copy so we make sure to notice the effects of the
-                // operation on the destreg (either needing to RA it if it's 
-                // virtual or needing to clobber any values if it's physical).
-                NextMII = &MI;
-                --NextMII;  // backtrack to the copy.
-              }
-              VRM.RemoveFromFoldedVirtMap(&MI);
-              MBB.erase(&MI);
-              goto ProcessNextInst;
+          // If this spill slot is available, turn it into a copy (or nothing)
+          // instead of leaving it as a load!
+          unsigned InReg;
+          if (FrameIdx == SS && (InReg = Spills.getSpillSlotPhysReg(SS))) {
+            DEBUG(std::cerr << "Promoted Load To Copy: " << MI);
+            MachineFunction &MF = *MBB.getParent();
+            if (DestReg != InReg) {
+              MRI->copyRegToReg(MBB, &MI, DestReg, InReg,
+                                MF.getSSARegMap()->getRegClass(VirtReg));
+              // Revisit the copy so we make sure to notice the effects of the
+              // operation on the destreg (either needing to RA it if it's 
+              // virtual or needing to clobber any values if it's physical).
+              NextMII = &MI;
+              --NextMII;  // backtrack to the copy.
             }
+            VRM.RemoveFromFoldedVirtMap(&MI);
+            MBB.erase(&MI);
+            goto ProcessNextInst;
           }
         }
       }
@@ -792,21 +791,7 @@
             VRM.RemoveFromFoldedVirtMap(&MI);
             goto ProcessNextInst;
           }
-          
-          // If it's not a no-op copy, it clobbers the value in the destreg.
           Spills.ClobberPhysReg(VirtReg);
- 
-          // Check to see if this instruction is a load from a stack slot into
-          // a register.  If so, this provides the stack slot value in the reg.
-          int FrameIdx;
-          if (unsigned DestReg = TII->isLoadFromStackSlot(&MI, FrameIdx)) {
-            assert(DestReg == VirtReg && "Unknown load situation!");
-            
-            // Otherwise, if it wasn't available, remember that it is now!
-            Spills.addAvailable(FrameIdx, DestReg);
-            goto ProcessNextInst;
-          }
-            
           continue;
         }
 






More information about the llvm-commits mailing list