diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-03-31 08:26:26 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-03-31 08:26:26 +0000 |
commit | 8fe00540fc6e1531d909d0688cc75a77b7dfa330 (patch) | |
tree | 56d4020e70d6a8011baf1a2efd0733143ed5753b /lib/CodeGen/VirtRegMap.cpp | |
parent | c4ef55119285fa2f966ee6578a58371c3c368774 (diff) |
Revert r68073. It's causing a failure in the Apple-style builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.cpp')
-rw-r--r-- | lib/CodeGen/VirtRegMap.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index cb0f764343..c5bfcfd301 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -188,7 +188,7 @@ void VirtRegMap::RemoveMachineInstrFromMaps(MachineInstr *MI) { if (MF->getFrameInfo()->isFixedObjectIndex(FI)) continue; // This stack reference was produced by instruction selection and - // is not a spill + // is not a spill. if (FI < LowSpillSlot) continue; assert((unsigned)FI-LowSpillSlot < SpillSlotToUsesMap.size() @@ -201,6 +201,27 @@ void VirtRegMap::RemoveMachineInstrFromMaps(MachineInstr *MI) { EmergencySpillMap.erase(MI); } +bool VirtRegMap::OnlyUseOfStackSlot(const MachineInstr *MI) const { + for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { + const MachineOperand &MO = MI->getOperand(i); + if (!MO.isFI()) + continue; + int FI = MO.getIndex(); + if (MF->getFrameInfo()->isFixedObjectIndex(FI)) + continue; + // This stack reference was produced by instruction selection and + // is not a spill. + if (FI < LowSpillSlot) + continue; + assert((unsigned)FI-LowSpillSlot < SpillSlotToUsesMap.size() + && "Invalid spill slot"); + if (SpillSlotToUsesMap[FI - LowSpillSlot].size() != 1) + return false; + } + + return true; +} + void VirtRegMap::print(std::ostream &OS, const Module* M) const { const TargetRegisterInfo* TRI = MF->getTarget().getRegisterInfo(); |