diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-12-03 21:31:55 +0000 | 
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-12-03 21:31:55 +0000 | 
| commit | 40965448ffdc29024f011933e9c667a986a781b0 (patch) | |
| tree | d0ef37a2d422fe9a110f76b313fa1c731ef12850 /llvm/lib/CodeGen | |
| parent | 4f76f22975fac81b2b8a9f9179ec9d148f602d91 (diff) | |
| download | bcm5719-llvm-40965448ffdc29024f011933e9c667a986a781b0.tar.gz bcm5719-llvm-40965448ffdc29024f011933e9c667a986a781b0.zip | |
Bug fixes.
llvm-svn: 44549
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 15 | 
1 files changed, 8 insertions, 7 deletions
| diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index 68c47736738..5650e3d01fa 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -276,7 +276,7 @@ namespace {                               SmallSet<MachineInstr*, 4> &ReMatDefs,                               BitVector &RegKills,                               std::vector<MachineOperand*> &KillOps, -                             VirtRegMap &VRM, bool StoreMaybeDead); +                             VirtRegMap &VRM);      void RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM);    };  } @@ -860,7 +860,7 @@ void LocalSpiller::SpillRegToStackSlot(MachineBasicBlock &MBB,                                    SmallSet<MachineInstr*, 4> &ReMatDefs,                                    BitVector &RegKills,                                    std::vector<MachineOperand*> &KillOps, -                                  VirtRegMap &VRM, bool StoreMaybeDead) { +                                  VirtRegMap &VRM) {    MRI->storeRegToStackSlot(MBB, next(MII), PhysReg, StackSlot, RC);    DOUT << "Store:\t" << *next(MII); @@ -896,15 +896,14 @@ void LocalSpiller::SpillRegToStackSlot(MachineBasicBlock &MBB,      }    } -  MachineInstr *NewStore = next(MII); -  LastStore = StoreMaybeDead ? NewStore : NULL; +  LastStore = next(MII);    // If the stack slot value was previously available in some other    // register, change it now.  Otherwise, make the register available,    // in PhysReg.    Spills.ModifyStackSlotOrReMat(StackSlot);    Spills.ClobberPhysReg(PhysReg); -  Spills.addAvailable(StackSlot, NewStore, PhysReg); +  Spills.addAvailable(StackSlot, LastStore, PhysReg);    ++NumStores;  } @@ -987,8 +986,9 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {          int StackSlot = VRM.getStackSlot(VirtReg);          MachineInstr *&LastStore = MaybeDeadStores[StackSlot];          SpillRegToStackSlot(MBB, MII, i, Phys, StackSlot, RC, LastStore, -                            Spills, ReMatDefs, RegKills, KillOps, VRM, false); +                            Spills, ReMatDefs, RegKills, KillOps, VRM);        } +      NextMII = next(MII);      }      /// ReusedOperands - Keep track of operand reuse in case we need to undo @@ -1447,7 +1447,8 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {        if (!MO.isDead()) {          MachineInstr *&LastStore = MaybeDeadStores[StackSlot];          SpillRegToStackSlot(MBB, MII, -1, PhysReg, StackSlot, RC, LastStore, -                            Spills, ReMatDefs, RegKills, KillOps, VRM, true); +                            Spills, ReMatDefs, RegKills, KillOps, VRM); +        NextMII = next(MII);          // Check to see if this is a noop copy.  If so, eliminate the          // instruction before considering the dest reg to be changed. | 

