|
LLVM
3.7.0
|
#include <LiveIntervalAnalysis.h>
Classes | |
| class | HMEditor |
Public Member Functions | |
| LiveIntervals () | |
| ~LiveIntervals () override | |
| LiveInterval & | getInterval (unsigned Reg) |
| const LiveInterval & | getInterval (unsigned Reg) const |
| bool | hasInterval (unsigned Reg) const |
| LiveInterval & | createEmptyInterval (unsigned Reg) |
| LiveInterval & | createAndComputeVirtRegInterval (unsigned Reg) |
| void | removeInterval (unsigned Reg) |
| LiveInterval::Segment | addSegmentToEndOfBlock (unsigned reg, MachineInstr *startInst) |
| Given a register and an instruction, adds a live segment from that instruction to the end of its MBB. More... | |
| bool | shrinkToUses (LiveInterval *li, SmallVectorImpl< MachineInstr * > *dead=nullptr) |
| shrinkToUses - After removing some uses of a register, shrink its live range to just the remaining uses. More... | |
| void | shrinkToUses (LiveInterval::SubRange &SR, unsigned Reg) |
| Specialized version of shrinkToUses(LiveInterval li, SmallVectorImpl<MachineInstr> *dead) that works on a subregister live range and only looks at uses matching the lane mask of the subregister range. More... | |
| void | extendToIndices (LiveRange &LR, ArrayRef< SlotIndex > Indices) |
| extendToIndices - Extend the live range of LI to reach all points in Indices. More... | |
| void | pruneValue (LiveRange &LR, SlotIndex Kill, SmallVectorImpl< SlotIndex > *EndPoints) |
If LR has a live value at Kill, prune its live range by removing any liveness reachable from Kill. More... | |
| SlotIndexes * | getSlotIndexes () const |
| AliasAnalysis * | getAliasAnalysis () const |
| bool | isNotInMIMap (const MachineInstr *Instr) const |
| isNotInMIMap - returns true if the specified machine instr has been removed or was never entered in the map. More... | |
| SlotIndex | getInstructionIndex (const MachineInstr *instr) const |
| Returns the base index of the given instruction. More... | |
| MachineInstr * | getInstructionFromIndex (SlotIndex index) const |
| Returns the instruction associated with the given index. More... | |
| SlotIndex | getMBBStartIdx (const MachineBasicBlock *mbb) const |
| Return the first index in the given basic block. More... | |
| SlotIndex | getMBBEndIdx (const MachineBasicBlock *mbb) const |
| Return the last index in the given basic block. More... | |
| bool | isLiveInToMBB (const LiveRange &LR, const MachineBasicBlock *mbb) const |
| bool | isLiveOutOfMBB (const LiveRange &LR, const MachineBasicBlock *mbb) const |
| MachineBasicBlock * | getMBBFromIndex (SlotIndex index) const |
| void | insertMBBInMaps (MachineBasicBlock *MBB) |
| SlotIndex | InsertMachineInstrInMaps (MachineInstr *MI) |
| void | InsertMachineInstrRangeInMaps (MachineBasicBlock::iterator B, MachineBasicBlock::iterator E) |
| void | RemoveMachineInstrFromMaps (MachineInstr *MI) |
| void | ReplaceMachineInstrInMaps (MachineInstr *MI, MachineInstr *NewMI) |
| bool | findLiveInMBBs (SlotIndex Start, SlotIndex End, SmallVectorImpl< MachineBasicBlock * > &MBBs) const |
| VNInfo::Allocator & | getVNInfoAllocator () |
| void | getAnalysisUsage (AnalysisUsage &AU) const override |
| getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. More... | |
| void | releaseMemory () override |
| releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. More... | |
| bool | runOnMachineFunction (MachineFunction &) override |
| runOnMachineFunction - pass entry point More... | |
| void | print (raw_ostream &O, const Module *=nullptr) const override |
| print - Implement the dump method. More... | |
| MachineBasicBlock * | intervalIsInOneMBB (const LiveInterval &LI) const |
| intervalIsInOneMBB - If LI is confined to a single basic block, return a pointer to that block. More... | |
| bool | hasPHIKill (const LiveInterval &LI, const VNInfo *VNI) const |
| Returns true if VNI is killed by any PHI-def values in LI. More... | |
| void | addKillFlags (const VirtRegMap *) |
| addKillFlags - Add kill flags to any instruction that kills a virtual register. More... | |
| void | handleMove (MachineInstr *MI, bool UpdateFlags=false) |
| handleMove - call this method to notify LiveIntervals that instruction 'mi' has been moved within a basic block. More... | |
| void | handleMoveIntoBundle (MachineInstr *MI, MachineInstr *BundleStart, bool UpdateFlags=false) |
| moveIntoBundle - Update intervals for operands of MI so that they begin/end on the SlotIndex for BundleStart. More... | |
| void | repairIntervalsInRange (MachineBasicBlock *MBB, MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, ArrayRef< unsigned > OrigRegs) |
| repairIntervalsInRange - Update live intervals for instructions in a range of iterators. More... | |
| ArrayRef< SlotIndex > | getRegMaskSlots () const |
| getRegMaskSlots - Returns a sorted array of slot indices of all instructions with register mask operands. More... | |
| ArrayRef< SlotIndex > | getRegMaskSlotsInBlock (unsigned MBBNum) const |
| getRegMaskSlotsInBlock - Returns a sorted array of slot indices of all instructions with register mask operands in the basic block numbered MBBNum. More... | |
| ArrayRef< const uint32_t * > | getRegMaskBits () const |
| getRegMaskBits() - Returns an array of register mask pointers corresponding to getRegMaskSlots(). More... | |
| ArrayRef< const uint32_t * > | getRegMaskBitsInBlock (unsigned MBBNum) const |
| getRegMaskBitsInBlock - Returns an array of mask pointers corresponding to getRegMaskSlotsInBlock(MBBNum). More... | |
| bool | checkRegMaskInterference (LiveInterval &LI, BitVector &UsableRegs) |
| checkRegMaskInterference - Test if LI is live across any register mask instructions, and compute a bit mask of physical registers that are not clobbered by any of them. More... | |
| LiveRange & | getRegUnit (unsigned Unit) |
| getRegUnit - Return the live range for Unit. More... | |
| LiveRange * | getCachedRegUnit (unsigned Unit) |
| getCachedRegUnit - Return the live range for Unit if it has already been computed, or NULL if it hasn't been computed yet. More... | |
| const LiveRange * | getCachedRegUnit (unsigned Unit) const |
| void | removePhysRegDefAt (unsigned Reg, SlotIndex Pos) |
Remove value numbers and related live segments starting at position Pos that are part of any liverange of physical register Reg or one of its subregisters. More... | |
| void | removeVRegDefAt (LiveInterval &LI, SlotIndex Pos) |
Remove value number and related live segments of LI and its subranges that start at position Pos. More... | |
Public Member Functions inherited from llvm::FunctionPass | |
| FunctionPass (char &pid) | |
| Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const override |
| createPrinterPass - Get a function printer pass. More... | |
| void | assignPassManager (PMStack &PMS, PassManagerType T) override |
| Find appropriate Function Pass Manager or Call Graph Pass Manager in the PM Stack and add self into that manager. More... | |
| PassManagerType | getPotentialPassManagerType () const override |
| Return what kind of Pass Manager can manage this pass. More... | |
Public Member Functions inherited from llvm::Pass | |
| Pass (PassKind K, char &pid) | |
| virtual | ~Pass () |
| PassKind | getPassKind () const |
| virtual const char * | getPassName () const |
| getPassName - Return a nice clean name for a pass. More... | |
| AnalysisID | getPassID () const |
| getPassID - Return the PassID number that corresponds to this pass. More... | |
| virtual bool | doInitialization (Module &) |
| doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run. More... | |
| virtual bool | doFinalization (Module &) |
| doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run. More... | |
| void | dump () const |
| virtual void | preparePassManager (PMStack &) |
| Check if available pass managers are suitable for this pass or not. More... | |
| void | setResolver (AnalysisResolver *AR) |
| AnalysisResolver * | getResolver () const |
| virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
| getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through multiple inheritance. More... | |
| virtual ImmutablePass * | getAsImmutablePass () |
| virtual PMDataManager * | getAsPMDataManager () |
| virtual void | verifyAnalysis () const |
| verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information. More... | |
| virtual void | dumpPassStructure (unsigned Offset=0) |
| template<typename AnalysisType > | |
| AnalysisType * | getAnalysisIfAvailable () const |
| getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it. More... | |
| bool | mustPreserveAnalysisID (char &AID) const |
| mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID. More... | |
| template<typename AnalysisType > | |
| AnalysisType & | getAnalysis () const |
| getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More... | |
| template<typename AnalysisType > | |
| AnalysisType & | getAnalysis (Function &F) |
| getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More... | |
| template<typename AnalysisType > | |
| AnalysisType & | getAnalysisID (AnalysisID PI) const |
| template<typename AnalysisType > | |
| AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Static Public Member Functions | |
| static float | getSpillWeight (bool isDef, bool isUse, const MachineBlockFrequencyInfo *MBFI, const MachineInstr *Instr) |
Static Public Member Functions inherited from llvm::Pass | |
| static const PassInfo * | lookupPassInfo (const void *TI) |
| static const PassInfo * | lookupPassInfo (StringRef Arg) |
| static Pass * | createPass (AnalysisID ID) |
Static Public Attributes | |
| static char | ID = 0 |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::MachineFunctionPass | |
| MachineFunctionPass (char &ID) | |
| void | getAnalysisUsage (AnalysisUsage &AU) const override |
| getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. More... | |
Protected Member Functions inherited from llvm::FunctionPass | |
| bool | skipOptnoneFunction (const Function &F) const |
| skipOptnoneFunction - This function has Attribute::OptimizeNone and most transformation passes should skip it. More... | |
Definition at line 53 of file LiveIntervalAnalysis.h.
| LiveIntervals::LiveIntervals | ( | ) |
Definition at line 94 of file LiveIntervalAnalysis.cpp.
References llvm::PassRegistry::getPassRegistry(), and llvm::initializeLiveIntervalsPass().
|
override |
Definition at line 99 of file LiveIntervalAnalysis.cpp.
| void LiveIntervals::addKillFlags | ( | const VirtRegMap * | VRM | ) |
addKillFlags - Add kill flags to any instruction that kills a virtual register.
Definition at line 639 of file LiveIntervalAnalysis.cpp.
References llvm::MachineInstr::addRegisterKilled(), llvm::LiveRange::advanceTo(), llvm::LiveRange::begin(), llvm::SmallVectorImpl< T >::clear(), llvm::MachineInstr::clearRegisterKills(), llvm::LiveRange::empty(), llvm::LiveRange::end(), llvm::LiveRange::find(), getInstructionFromIndex(), getInterval(), llvm::MachineRegisterInfo::getNumVirtRegs(), llvm::VirtRegMap::getPhys(), getRegUnit(), llvm::TargetRegisterInfo::getSubRegIndexLaneMask(), llvm::TargetRegisterInfo::index2VirtReg(), llvm::MCRegisterInfo::DiffListIterator::isValid(), llvm::LiveInterval::SubRange::LaneMask, N, llvm::MachineInstr::operands(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MachineRegisterInfo::reg_nodbg_empty(), llvm::LiveInterval::subranges(), and llvm::MachineRegisterInfo::subRegLivenessEnabled().
| LiveRange::Segment LiveIntervals::addSegmentToEndOfBlock | ( | unsigned | reg, |
| MachineInstr * | startInst | ||
| ) |
Given a register and an instruction, adds a live segment from that instruction to the end of its MBB.
Definition at line 820 of file LiveIntervalAnalysis.cpp.
References llvm::LiveRange::addSegment(), createEmptyInterval(), getInstructionIndex(), getMBBEndIdx(), llvm::LiveRange::getNextValue(), llvm::MachineInstr::getParent(), and getVNInfoAllocator().
| bool LiveIntervals::checkRegMaskInterference | ( | LiveInterval & | LI, |
| BitVector & | UsableRegs | ||
| ) |
checkRegMaskInterference - Test if LI is live across any register mask instructions, and compute a bit mask of physical registers that are not clobbered by any of them.
Returns false if LI doesn't cross any register mask instructions. In that case, the bit vector is not filled in.
Definition at line 838 of file LiveIntervalAnalysis.cpp.
References llvm::LiveRange::advanceTo(), llvm::ArrayRef< T >::begin(), llvm::LiveRange::begin(), llvm::tgtok::Bits, llvm::BitVector::clear(), llvm::BitVector::clearBitsNotInMask(), llvm::LiveRange::empty(), llvm::sys::path::end(), llvm::ArrayRef< T >::end(), llvm::LiveRange::end(), Found(), llvm::MachineBasicBlock::getNumber(), llvm::MCRegisterInfo::getNumRegs(), getRegMaskBits(), getRegMaskBitsInBlock(), getRegMaskSlots(), getRegMaskSlotsInBlock(), intervalIsInOneMBB(), and llvm::BitVector::resize().
Referenced by llvm::LiveRegMatrix::checkRegMaskInterference().
|
inline |
Definition at line 133 of file LiveIntervalAnalysis.h.
References createEmptyInterval().
Referenced by getInterval(), and repairIntervalsInRange().
|
inline |
Definition at line 126 of file LiveIntervalAnalysis.h.
References hasInterval().
Referenced by addSegmentToEndOfBlock(), createAndComputeVirtRegInterval(), and llvm::LiveRangeEdit::createEmptyIntervalFrom().
extendToIndices - Extend the live range of LI to reach all points in Indices.
The points in the Indices array must be jointly dominated by existing defs in LI. PHI-defs are added as needed to maintain SSA form.
If a SlotIndex in Indices is the end index of a basic block, LI will be extended to be live out of the basic block.
See also LiveRangeCalc::extend().
Definition at line 567 of file LiveIntervalAnalysis.cpp.
References llvm::LiveRangeCalc::extend(), getSlotIndexes(), getVNInfoAllocator(), llvm::LiveRangeCalc::reset(), and llvm::ArrayRef< T >::size().
|
inline |
Definition at line 260 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::findLiveInMBBs().
|
inline |
Definition at line 191 of file LiveIntervalAnalysis.h.
Referenced by isRematerializable().
|
overridevirtual |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job.
If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.
Reimplemented from llvm::Pass.
Definition at line 77 of file LiveIntervalAnalysis.cpp.
References llvm::AnalysisUsage::addPreserved(), llvm::AnalysisUsage::addPreservedID(), llvm::AnalysisUsage::addRequired(), llvm::AnalysisUsage::addRequiredTransitive(), llvm::AnalysisUsage::addRequiredTransitiveID(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::MachineDominatorsID, llvm::MachineLoopInfoID, and llvm::AnalysisUsage::setPreservesCFG().
getCachedRegUnit - Return the live range for Unit if it has already been computed, or NULL if it hasn't been computed yet.
Definition at line 392 of file LiveIntervalAnalysis.h.
Referenced by llvm::RegPressureTracker::getLiveRange(), and removePhysRegDefAt().
Definition at line 396 of file LiveIntervalAnalysis.h.
|
inline |
Returns the instruction associated with the given index.
Definition at line 207 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::getInstructionFromIndex().
Referenced by addKillFlags(), llvm::ScheduleDAGInstrs::addVRegUseDeps(), llvm::LiveRangeEdit::canRematerializeAt(), llvm::SplitEditor::enterIntvAfter(), llvm::SplitEditor::enterIntvBefore(), findInsertLocation(), llvm::SplitAnalysis::getLastSplitPointIter(), isRematerializable(), llvm::SplitEditor::leaveIntvAfter(), llvm::SplitEditor::leaveIntvBefore(), and llvm::SplitAnalysis::shouldSplitSingleBlock().
|
inline |
Returns the base index of the given instruction.
Definition at line 202 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::getInstructionIndex().
Referenced by addSegmentToEndOfBlock(), llvm::ScheduleDAGInstrs::addVRegUseDeps(), llvm::RegPressureTracker::bumpDownwardPressure(), llvm::RegPressureTracker::bumpUpwardPressure(), llvm::LiveRangeEdit::canRematerializeAt(), dumpMachineInstrRangeWithSlotIndex(), findUseBetween(), llvm::RegPressureTracker::getCurrSlot(), isPlainlyKilled(), llvm::RegPressureTracker::recede(), regJustKilledBefore(), repairIntervalsInRange(), and shrinkToUses().
|
inline |
Definition at line 110 of file LiveIntervalAnalysis.h.
References createAndComputeVirtRegInterval(), and hasInterval().
Referenced by addKillFlags(), llvm::ScheduleDAGInstrs::addVRegUseDeps(), llvm::RegAllocBase::allocatePhysRegs(), llvm::LiveRangeEdit::calculateRegClassAndHint(), llvm::calculateSpillWeightsAndHints(), llvm::SplitEditor::finish(), getInterval(), llvm::RegPressureTracker::getLiveRange(), isLocalCopy(), llvm::SplitAnalysis::isOriginalEndpoint(), isPlainlyKilled(), print(), regJustKilledBefore(), and repairIntervalsInRange().
|
inline |
Definition at line 117 of file LiveIntervalAnalysis.h.
References getInterval().
|
inline |
Return the last index in the given basic block.
Definition at line 217 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::getMBBEndIdx().
Referenced by addSegmentToEndOfBlock(), llvm::SplitAnalysis::countLiveBlocks(), llvm::SplitEditor::enterIntvAtEnd(), llvm::RegPressureTracker::getCurrSlot(), llvm::SplitAnalysis::getLastSplitPointIter(), handleMove(), isLiveOutOfMBB(), repairIntervalsInRange(), and llvm::SplitEditor::useIntv().
|
inline |
Definition at line 231 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::getMBBFromIndex().
Referenced by llvm::SplitAnalysis::countLiveBlocks(), hasPHIKill(), and llvm::SplitEditor::overlapIntv().
|
inline |
Return the first index in the given basic block.
Definition at line 212 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::getMBBStartIdx().
Referenced by findInsertLocation(), handleMove(), isLiveInToMBB(), llvm::SplitEditor::leaveIntvAtTop(), and llvm::SplitEditor::useIntv().
getRegMaskBits() - Returns an array of register mask pointers corresponding to getRegMaskSlots().
Definition at line 348 of file LiveIntervalAnalysis.h.
Referenced by checkRegMaskInterference(), and getRegMaskBitsInBlock().
|
inline |
getRegMaskBitsInBlock - Returns an array of mask pointers corresponding to getRegMaskSlotsInBlock(MBBNum).
Definition at line 352 of file LiveIntervalAnalysis.h.
References getRegMaskBits(), and P.
Referenced by checkRegMaskInterference().
getRegMaskSlots - Returns a sorted array of slot indices of all instructions with register mask operands.
Definition at line 336 of file LiveIntervalAnalysis.h.
Referenced by checkRegMaskInterference(), and getRegMaskSlotsInBlock().
getRegMaskSlotsInBlock - Returns a sorted array of slot indices of all instructions with register mask operands in the basic block numbered MBBNum.
Definition at line 341 of file LiveIntervalAnalysis.h.
References getRegMaskSlots(), and P.
Referenced by checkRegMaskInterference().
getRegUnit - Return the live range for Unit.
It will be computed if it doesn't exist.
Definition at line 379 of file LiveIntervalAnalysis.h.
References llvm::UseSegmentSetForPhysRegs.
Referenced by addKillFlags(), llvm::LiveRegMatrix::checkRegUnitInterference(), and runOnMachineFunction().
|
inline |
Definition at line 187 of file LiveIntervalAnalysis.h.
Referenced by llvm::VirtRegAuxInfo::calculateSpillWeightAndHint(), llvm::LiveRegMatrix::checkRegUnitInterference(), extendToIndices(), llvm::LiveRangeEdit::rematerializeAt(), llvm::SplitEditor::reset(), llvm::SplitEditor::splitLiveThroughBlock(), llvm::SplitEditor::splitRegInBlock(), and llvm::SplitEditor::splitRegOutBlock().
|
static |
Definition at line 811 of file LiveIntervalAnalysis.cpp.
References llvm::MachineBlockFrequencyInfo::getBlockFreq(), llvm::MachineBlockFrequencyInfo::getEntryFreq(), llvm::BlockFrequency::getFrequency(), and llvm::MachineInstr::getParent().
Referenced by llvm::VirtRegAuxInfo::calculateSpillWeightAndHint().
|
inline |
Definition at line 265 of file LiveIntervalAnalysis.h.
Referenced by addSegmentToEndOfBlock(), extendToIndices(), and llvm::SplitEditor::reset().
| void LiveIntervals::handleMove | ( | MachineInstr * | MI, |
| bool | UpdateFlags = false |
||
| ) |
handleMove - call this method to notify LiveIntervals that instruction 'mi' has been moved within a basic block.
This will update the live intervals for all operands of mi. Moves between basic blocks are not supported.
| UpdateFlags | Update live intervals for nonallocatable physregs. |
Definition at line 1232 of file LiveIntervalAnalysis.cpp.
References llvm::SlotIndexes::getInstructionIndex(), getMBBEndIdx(), getMBBStartIdx(), llvm::MachineInstr::getParent(), llvm::SlotIndexes::insertMachineInstrInMaps(), llvm::MachineInstr::isBundled(), llvm::SlotIndexes::removeMachineInstrFromMaps(), and llvm::LiveIntervals::HMEditor::updateAllRanges().
| void LiveIntervals::handleMoveIntoBundle | ( | MachineInstr * | MI, |
| MachineInstr * | BundleStart, | ||
| bool | UpdateFlags = false |
||
| ) |
moveIntoBundle - Update intervals for operands of MI so that they begin/end on the SlotIndex for BundleStart.
| UpdateFlags | Update live intervals for nonallocatable physregs. |
Requires MI and BundleStart to have SlotIndexes, and assumes existing liveness is accurate. BundleStart should be the first instruction in the Bundle.
Definition at line 1245 of file LiveIntervalAnalysis.cpp.
References llvm::SlotIndexes::getInstructionIndex(), and llvm::LiveIntervals::HMEditor::updateAllRanges().
Definition at line 121 of file LiveIntervalAnalysis.h.
Referenced by createEmptyInterval(), getInterval(), print(), and repairIntervalsInRange().
| bool LiveIntervals::hasPHIKill | ( | const LiveInterval & | LI, |
| const VNInfo * | VNI | ||
| ) | const |
Returns true if VNI is killed by any PHI-def values in LI.
This may conservatively return true to avoid expensive computations.
Definition at line 794 of file LiveIntervalAnalysis.cpp.
References llvm::VNInfo::def, llvm::SlotIndexes::getMBBEndIdx(), getMBBFromIndex(), llvm::LiveRange::getVNInfoBefore(), llvm::VNInfo::isPHIDef(), llvm::VNInfo::isUnused(), llvm::TargetOpcode::PHI, llvm::MachineBasicBlock::pred_begin(), llvm::MachineBasicBlock::pred_end(), llvm::MachineBasicBlock::pred_size(), and llvm::LiveRange::valnos.
|
inline |
Definition at line 242 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::insertMachineInstrInMaps().
|
inline |
Definition at line 246 of file LiveIntervalAnalysis.h.
References I, and llvm::SlotIndexes::insertMachineInstrInMaps().
|
inline |
| MachineBasicBlock * LiveIntervals::intervalIsInOneMBB | ( | const LiveInterval & | LI | ) | const |
intervalIsInOneMBB - If LI is confined to a single basic block, return a pointer to that block.
If LI is live in to or out of any block, return NULL.
Definition at line 770 of file LiveIntervalAnalysis.cpp.
References llvm::LiveRange::beginIndex(), llvm::LiveRange::endIndex(), llvm::SlotIndexes::getMBBFromIndex(), and llvm::SlotIndex::isBlock().
Referenced by checkRegMaskInterference(), and isLocalCopy().
|
inline |
Definition at line 221 of file LiveIntervalAnalysis.h.
References getMBBStartIdx(), and llvm::LiveRange::liveAt().
|
inline |
Definition at line 226 of file LiveIntervalAnalysis.h.
References getMBBEndIdx(), and llvm::LiveRange::liveAt().
Referenced by llvm::VirtRegAuxInfo::calculateSpillWeightAndHint().
|
inline |
isNotInMIMap - returns true if the specified machine instr has been removed or was never entered in the map.
Definition at line 197 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::hasIndex().
Referenced by isPlainlyKilled().
|
overridevirtual |
print - Implement the dump method.
Reimplemented from llvm::Pass.
Definition at line 155 of file LiveIntervalAnalysis.cpp.
References getInterval(), llvm::MachineRegisterInfo::getNumVirtRegs(), hasInterval(), and llvm::TargetRegisterInfo::index2VirtReg().
| void LiveIntervals::pruneValue | ( | LiveRange & | LR, |
| SlotIndex | Kill, | ||
| SmallVectorImpl< SlotIndex > * | EndPoints | ||
| ) |
If LR has a live value at Kill, prune its live range by removing any liveness reachable from Kill.
Add live range end points to EndPoints such that extendToIndices(LI, EndPoints) will reconstruct the value's live range.
Calling pruneValue() and extendToIndices() can be used to reconstruct SSA form after adding defs to a virtual register.
Definition at line 575 of file LiveIntervalAnalysis.cpp.
References llvm::df_ext_begin(), llvm::df_ext_end(), llvm::LiveQueryResult::endPoint(), llvm::SlotIndexes::getMBBEndIdx(), llvm::SlotIndexes::getMBBFromIndex(), llvm::SlotIndexes::getMBBRange(), I, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::LiveRange::Query(), llvm::LiveRange::removeSegment(), llvm::MachineBasicBlock::succ_begin(), llvm::MachineBasicBlock::succ_end(), llvm::LiveQueryResult::valueIn(), and llvm::LiveQueryResult::valueOutOrDead().
|
overridevirtual |
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed.
The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.
Optionally implement this function to release pass memory when it is no longer used.
Reimplemented from llvm::Pass.
Definition at line 103 of file LiveIntervalAnalysis.cpp.
References llvm::SmallVectorImpl< T >::clear(), llvm::TargetRegisterInfo::index2VirtReg(), and llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold >::Reset().
|
inline |
Definition at line 140 of file LiveIntervalAnalysis.h.
Referenced by llvm::RegAllocBase::allocatePhysRegs(), and llvm::LiveRangeEdit::eraseVirtReg().
|
inline |
Definition at line 252 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::removeMachineInstrFromMaps().
Remove value numbers and related live segments starting at position Pos that are part of any liverange of physical register Reg or one of its subregisters.
Definition at line 1394 of file LiveIntervalAnalysis.cpp.
References getCachedRegUnit(), llvm::LiveRange::getVNInfoAt(), llvm::MCRegisterInfo::DiffListIterator::isValid(), and llvm::LiveRange::removeValNo().
| void LiveIntervals::removeVRegDefAt | ( | LiveInterval & | LI, |
| SlotIndex | Pos | ||
| ) |
Remove value number and related live segments of LI and its subranges that start at position Pos.
Definition at line 1402 of file LiveIntervalAnalysis.cpp.
References llvm::LiveRange::getVNInfoAt(), llvm::LiveInterval::removeEmptySubRanges(), llvm::LiveRange::removeValNo(), and llvm::LiveInterval::subranges().
| void LiveIntervals::repairIntervalsInRange | ( | MachineBasicBlock * | MBB, |
| MachineBasicBlock::iterator | Begin, | ||
| MachineBasicBlock::iterator | End, | ||
| ArrayRef< unsigned > | OrigRegs | ||
| ) |
repairIntervalsInRange - Update live intervals for instructions in a range of iterators.
It is intended for use after target hooks that may insert or remove instructions, and is only efficient for a small number of instructions.
OrigRegs is a vector of registers that were originally used by the instructions in the range between the two iterators.
Currently, the only only changes that are supported are simple removal and addition of uses.
Definition at line 1343 of file LiveIntervalAnalysis.cpp.
References llvm::MachineBasicBlock::begin(), createAndComputeVirtRegInterval(), llvm::MachineBasicBlock::end(), getInstructionIndex(), getInterval(), getMBBEndIdx(), llvm::SlotIndex::getPrevSlot(), llvm::LiveRange::hasAtLeastOneValue(), llvm::SlotIndexes::hasIndex(), hasInterval(), I, llvm::MachineInstr::isDebugValue(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::MachineInstr::operands_begin(), llvm::MachineInstr::operands_end(), llvm::SlotIndexes::repairIndexesInRange(), llvm::ArrayRef< T >::size(), and llvm::LiveInterval::subranges().
|
inline |
Definition at line 256 of file LiveIntervalAnalysis.h.
References llvm::SlotIndexes::replaceMachineInstrInMaps().
|
overridevirtual |
runOnMachineFunction - pass entry point
runOnMachineFunction - calculates LiveIntervals
Implements llvm::MachineFunctionPass.
Definition at line 122 of file LiveIntervalAnalysis.cpp.
References DEBUG, llvm::Pass::dump(), EnablePrecomputePhysRegs(), EnableSubRegLiveness, llvm::TargetSubtargetInfo::enableSubRegLiveness(), llvm::MachineRegisterInfo::enableSubRegLiveness(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MCRegisterInfo::getNumRegUnits(), llvm::MachineRegisterInfo::getNumVirtRegs(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), getRegUnit(), and llvm::MachineFunction::getSubtarget().
| bool LiveIntervals::shrinkToUses | ( | LiveInterval * | li, |
| SmallVectorImpl< MachineInstr * > * | dead = nullptr |
||
| ) |
shrinkToUses - 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 uses, and it doesn't remove dead defs. Dead PHIDef values are marked as unused. New dead machine instructions are added to the dead vector. Return true if the interval may have been separated into multiple connected components.
This method does not compute reaching defs for new uses, and it doesn't remove dead defs.
Definition at line 402 of file LiveIntervalAnalysis.cpp.
References createSegmentsForValues(), llvm::dbgs(), DEBUG, extendSegmentsToUses(), getInstructionIndex(), llvm::SlotIndex::getRegSlot(), I, llvm::MachineInstr::isDebugValue(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::make_range(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::LiveRange::Query(), llvm::MachineInstr::readsVirtualRegister(), llvm::LiveInterval::reg, llvm::MachineRegisterInfo::reg_instr_begin(), llvm::MachineRegisterInfo::reg_instr_end(), llvm::LiveRange::segments, llvm::LiveInterval::subranges(), llvm::SmallVectorImpl< T >::swap(), llvm::LiveQueryResult::valueDefined(), llvm::LiveQueryResult::valueIn(), llvm::LiveRange::vni_begin(), and llvm::LiveRange::vni_end().
Referenced by llvm::LiveRangeEdit::eliminateDeadDefs().
| void LiveIntervals::shrinkToUses | ( | LiveInterval::SubRange & | SR, |
| unsigned | Reg | ||
| ) |
Specialized version of shrinkToUses(LiveInterval li, SmallVectorImpl<MachineInstr> *dead) that works on a subregister live range and only looks at uses matching the lane mask of the subregister range.
Definition at line 498 of file LiveIntervalAnalysis.cpp.
References createSegmentsForValues(), llvm::dbgs(), DEBUG, llvm::VNInfo::def, llvm::LiveRange::Segment::end, extendSegmentsToUses(), llvm::SlotIndex::getDeadSlot(), getInstructionIndex(), llvm::MachineInstr::getParent(), llvm::SlotIndex::getRegSlot(), llvm::LiveRange::getSegmentContaining(), llvm::TargetRegisterInfo::getSubRegIndexLaneMask(), llvm::MachineInstr::isDebugValue(), llvm::VNInfo::isPHIDef(), llvm::VNInfo::isUnused(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::LiveInterval::SubRange::LaneMask, llvm::make_range(), llvm::VNInfo::markUnused(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::LiveRange::Query(), llvm::MachineRegisterInfo::reg_operands(), llvm::LiveRange::removeSegment(), llvm::LiveRange::segments, llvm::SmallVectorImpl< T >::swap(), llvm::LiveRange::valnos, llvm::LiveQueryResult::valueDefined(), llvm::LiveQueryResult::valueIn(), llvm::LiveRange::vni_begin(), and llvm::LiveRange::vni_end().
|
static |
Definition at line 101 of file LiveIntervalAnalysis.h.
1.8.6