From da2ed648b59c6e6b3a66c35baaefdc894ab1dff4 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Sun, 19 Feb 2012 03:09:55 +0000 Subject: [PATCH] Fix TODO and trailing whitespace. llvm-svn: 150910 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 2a7830dcc6b7..e0a9a74d411a 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -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; @@ -1135,7 +1139,7 @@ private: if (LR->end > OldIdx.getDeadSlot()) Exiting.insert(std::make_pair(LI, LR)); else - Internal.insert(std::make_pair(LI, LR)); + Internal.insert(std::make_pair(LI, LR)); } else if (MO.isDead()) { LiveRange* LR = LI->getLiveRangeContaining(OldIdx.getRegSlot()); assert(LR != 0 && "No dead-def range?");