Fix TODO and trailing whitespace.

llvm-svn: 150910
This commit is contained in:
Lang Hames 2012-02-19 03:09:55 +00:00
parent 4645a72763
commit da2ed648b5
1 changed files with 14 additions and 10 deletions

View File

@ -1047,12 +1047,16 @@ public:
void moveAllOperandsFrom(MachineInstr* MI, SlotIndex OldIdx) { void moveAllOperandsFrom(MachineInstr* MI, SlotIndex OldIdx) {
// Collect the operands. // Collect the operands.
RangeSet Entering, Internal, Exiting; RangeSet Entering, Internal, Exiting;
collectRanges(MI, Entering, Internal, Exiting, OldIdx); bool hasRegMaskOp = false;
collectRanges(MI, Entering, Internal, Exiting, hasRegMaskOp, OldIdx);
moveAllEnteringFrom(OldIdx, Entering); moveAllEnteringFrom(OldIdx, Entering);
moveAllInternalFrom(OldIdx, Internal); moveAllInternalFrom(OldIdx, Internal);
moveAllExitingFrom(OldIdx, Exiting); moveAllExitingFrom(OldIdx, Exiting);
if (hasRegMaskOp)
updateRegMaskSlots(OldIdx);
#ifndef NDEBUG #ifndef NDEBUG
LIValidator validator; LIValidator validator;
std::for_each(Entering.begin(), Entering.end(), validator); std::for_each(Entering.begin(), Entering.end(), validator);
@ -1061,13 +1065,6 @@ public:
assert(validator.rangesOk() && "moveOperandsFrom broke liveness."); assert(validator.rangesOk() && "moveOperandsFrom broke liveness.");
#endif #endif
// TODO: Update reg mask slots.
// assert((OldIdx == SlotIndex() || !MO.isRegMask()) &&
// "Unexpected RegMask operand.");
// if (MO.isRegMask()) {
// updateRegMaskSlots(OldIdx);
// continue;
// }
} }
private: private:
@ -1104,11 +1101,18 @@ private:
// Treat's MI's index as OldIdx (regardless of what it is in SlotIndexes' // Treat's MI's index as OldIdx (regardless of what it is in SlotIndexes'
// maps). // maps).
void collectRanges(MachineInstr* MI, RangeSet& Entering, RangeSet& Internal, void collectRanges(MachineInstr* MI, RangeSet& Entering, RangeSet& Internal,
RangeSet& Exiting, SlotIndex OldIdx) { RangeSet& Exiting, bool& hasRegMaskOp, SlotIndex OldIdx) {
hasRegMaskOp = false;
for (MachineInstr::mop_iterator MOI = MI->operands_begin(), for (MachineInstr::mop_iterator MOI = MI->operands_begin(),
MOE = MI->operands_end(); MOE = MI->operands_end();
MOI != MOE; ++MOI) { MOI != MOE; ++MOI) {
const MachineOperand& MO = *MOI; const MachineOperand& MO = *MOI;
if (MO.isRegMask()) {
hasRegMaskOp = true;
continue;
}
if (!MO.isReg() || MO.getReg() == 0) if (!MO.isReg() || MO.getReg() == 0)
continue; continue;
@ -1135,7 +1139,7 @@ private:
if (LR->end > OldIdx.getDeadSlot()) if (LR->end > OldIdx.getDeadSlot())
Exiting.insert(std::make_pair(LI, LR)); Exiting.insert(std::make_pair(LI, LR));
else else
Internal.insert(std::make_pair(LI, LR)); Internal.insert(std::make_pair(LI, LR));
} else if (MO.isDead()) { } else if (MO.isDead()) {
LiveRange* LR = LI->getLiveRangeContaining(OldIdx.getRegSlot()); LiveRange* LR = LI->getLiveRangeContaining(OldIdx.getRegSlot());
assert(LR != 0 && "No dead-def range?"); assert(LR != 0 && "No dead-def range?");