diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-03-30 20:21:35 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-03-30 20:21:35 +0000 |
commit | 7cb33c86522d05a5b10757e7b1593488e28a2431 (patch) | |
tree | 8ce10a312052516c695ad9365531d22e413995f2 | |
parent | 2f524575396b740b8bdae076b5711e602e82f834 (diff) |
Don't add the same MI to register reuse "last def/use" twice if it reads the
register more than once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35513 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/VirtRegMap.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index 2532fa31c8..d651f9d05f 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -316,7 +316,9 @@ public: assert(II != SpillSlotsAvailable.end() && "Slot not available!"); unsigned Val = II->second.first; assert((Val >> 1) == PhysReg && "Bidirectional map mismatch!"); - II->second.second.push_back(Use); + // This can be true if there are multiple uses of the same register. + if (II->second.second.back() != Use) + II->second.second.push_back(Use); } } @@ -1117,6 +1119,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM, if (TII->isMoveInstr(MI, Src, Dst) && Src == Dst) { ++NumDCE; DOUT << "Removing now-noop copy: " << MI; + Spills.removeLastUse(Src, &MI); MBB.erase(&MI); VRM.RemoveFromFoldedVirtMap(&MI); goto ProcessNextInst; |