forked from OSchip/llvm-project
parent
4645a72763
commit
da2ed648b5
|
@ -1047,12 +1047,16 @@ public:
|
|||
void moveAllOperandsFrom(MachineInstr* MI, SlotIndex OldIdx) {
|
||||
// Collect the operands.
|
||||
RangeSet Entering, Internal, Exiting;
|
||||
collectRanges(MI, Entering, Internal, Exiting, OldIdx);
|
||||
bool hasRegMaskOp = false;
|
||||
collectRanges(MI, Entering, Internal, Exiting, hasRegMaskOp, OldIdx);
|
||||
|
||||
moveAllEnteringFrom(OldIdx, Entering);
|
||||
moveAllInternalFrom(OldIdx, Internal);
|
||||
moveAllExitingFrom(OldIdx, Exiting);
|
||||
|
||||
if (hasRegMaskOp)
|
||||
updateRegMaskSlots(OldIdx);
|
||||
|
||||
#ifndef NDEBUG
|
||||
LIValidator validator;
|
||||
std::for_each(Entering.begin(), Entering.end(), validator);
|
||||
|
@ -1061,13 +1065,6 @@ public:
|
|||
assert(validator.rangesOk() && "moveOperandsFrom broke liveness.");
|
||||
#endif
|
||||
|
||||
// TODO: Update reg mask slots.
|
||||
// assert((OldIdx == SlotIndex() || !MO.isRegMask()) &&
|
||||
// "Unexpected RegMask operand.");
|
||||
// if (MO.isRegMask()) {
|
||||
// updateRegMaskSlots(OldIdx);
|
||||
// continue;
|
||||
// }
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -1104,11 +1101,18 @@ private:
|
|||
// Treat's MI's index as OldIdx (regardless of what it is in SlotIndexes'
|
||||
// maps).
|
||||
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(),
|
||||
MOE = MI->operands_end();
|
||||
MOI != MOE; ++MOI) {
|
||||
const MachineOperand& MO = *MOI;
|
||||
|
||||
if (MO.isRegMask()) {
|
||||
hasRegMaskOp = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!MO.isReg() || MO.getReg() == 0)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in New Issue