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 | c4b08e5eb000c7f6431d9a287cd7257cbb620b0e (patch) | |
tree | 799ee6884c2d1bf2cdd904ad85cb7037208107f8 /llvm/lib/CodeGen/VirtRegMap.cpp | |
parent | fe4847e331919fae7976cd72d1d021fcf613642f (diff) | |
download | bcm5719-llvm-c4b08e5eb000c7f6431d9a287cd7257cbb620b0e.tar.gz bcm5719-llvm-c4b08e5eb000c7f6431d9a287cd7257cbb620b0e.zip |
Revert r68073. It's causing a failure in the Apple-style builds.
llvm-svn: 68092
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegMap.cpp')
-rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index cb0f764343e..c5bfcfd3012 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/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(); |