diff options
Diffstat (limited to 'include/llvm/CodeGen/LiveIntervalAnalysis.h')
-rw-r--r-- | include/llvm/CodeGen/LiveIntervalAnalysis.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index 87421e2f83b4a..d4ee0582cc412 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -31,7 +31,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetRegisterInfo.h" #include <cmath> -#include <iterator> namespace llvm { @@ -105,7 +104,7 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs; // Calculate the spill weight to assign to a single instruction. static float getSpillWeight(bool isDef, bool isUse, const MachineBlockFrequencyInfo *MBFI, - const MachineInstr *Instr); + const MachineInstr &Instr); LiveInterval &getInterval(unsigned Reg) { if (hasInterval(Reg)) @@ -145,7 +144,7 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs; /// Given a register and an instruction, adds a live segment from that /// instruction to the end of its MBB. LiveInterval::Segment addSegmentToEndOfBlock(unsigned reg, - MachineInstr* startInst); + MachineInstr &startInst); /// After removing some uses of a register, shrink its live range to just /// the remaining uses. This method does not compute reaching defs for new @@ -195,13 +194,13 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs; /// isNotInMIMap - returns true if the specified machine instr has been /// removed or was never entered in the map. - bool isNotInMIMap(const MachineInstr* Instr) const { + bool isNotInMIMap(const MachineInstr &Instr) const { return !Indexes->hasIndex(Instr); } /// Returns the base index of the given instruction. - SlotIndex getInstructionIndex(const MachineInstr *instr) const { - return Indexes->getInstructionIndex(instr); + SlotIndex getInstructionIndex(const MachineInstr &Instr) const { + return Indexes->getInstructionIndex(Instr); } /// Returns the instruction associated with the given index. @@ -240,21 +239,21 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs; RegMaskBlocks.push_back(std::make_pair(RegMaskSlots.size(), 0)); } - SlotIndex InsertMachineInstrInMaps(MachineInstr *MI) { + SlotIndex InsertMachineInstrInMaps(MachineInstr &MI) { return Indexes->insertMachineInstrInMaps(MI); } void InsertMachineInstrRangeInMaps(MachineBasicBlock::iterator B, MachineBasicBlock::iterator E) { for (MachineBasicBlock::iterator I = B; I != E; ++I) - Indexes->insertMachineInstrInMaps(I); + Indexes->insertMachineInstrInMaps(*I); } - void RemoveMachineInstrFromMaps(MachineInstr *MI) { + void RemoveMachineInstrFromMaps(MachineInstr &MI) { Indexes->removeMachineInstrFromMaps(MI); } - void ReplaceMachineInstrInMaps(MachineInstr *MI, MachineInstr *NewMI) { + void ReplaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) { Indexes->replaceMachineInstrInMaps(MI, NewMI); } @@ -288,7 +287,7 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs; /// are not supported. /// /// \param UpdateFlags Update live intervals for nonallocatable physregs. - void handleMove(MachineInstr* MI, bool UpdateFlags = false); + void handleMove(MachineInstr &MI, bool UpdateFlags = false); /// moveIntoBundle - Update intervals for operands of MI so that they /// begin/end on the SlotIndex for BundleStart. @@ -298,7 +297,7 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs; /// Requires MI and BundleStart to have SlotIndexes, and assumes /// existing liveness is accurate. BundleStart should be the first /// instruction in the Bundle. - void handleMoveIntoBundle(MachineInstr* MI, MachineInstr* BundleStart, + void handleMoveIntoBundle(MachineInstr &MI, MachineInstr &BundleStart, bool UpdateFlags = false); /// repairIntervalsInRange - Update live intervals for instructions in a @@ -406,6 +405,11 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs; void splitSeparateComponents(LiveInterval &LI, SmallVectorImpl<LiveInterval*> &SplitLIs); + /// For live interval \p LI with correct SubRanges construct matching + /// information for the main live range. Expects the main live range to not + /// have any segments or value numbers. + void constructMainRangeFromSubranges(LiveInterval &LI); + private: /// Compute live intervals for all virtual registers. void computeVirtRegs(); |