LLVM API Documentation
#include <SplitKit.h>
Classes | |
struct | BlockInfo |
Public Types | |
typedef SmallPtrSet< const MachineBasicBlock *, 16 > | BlockPtrSet |
Public Member Functions | |
SplitAnalysis (const VirtRegMap &vrm, const LiveIntervals &lis, const MachineLoopInfo &mli) | |
void | analyze (const LiveInterval *li) |
bool | didRepairRange () const |
void | clear () |
const LiveInterval & | getParent () const |
getParent - Return the last analyzed interval. More... | |
SlotIndex | getLastSplitPoint (unsigned Num) |
MachineBasicBlock::iterator | getLastSplitPointIter (MachineBasicBlock *) |
getLastSplitPointIter - Returns the last split point as an iterator. More... | |
bool | isOriginalEndpoint (SlotIndex Idx) const |
ArrayRef< SlotIndex > | getUseSlots () const |
ArrayRef< BlockInfo > | getUseBlocks () const |
unsigned | getNumThroughBlocks () const |
getNumThroughBlocks - Return the number of through blocks. More... | |
bool | isThroughBlock (unsigned MBB) const |
isThroughBlock - Return true if CurLI is live through MBB without uses. More... | |
const BitVector & | getThroughBlocks () const |
getThroughBlocks - Return the set of through blocks. More... | |
unsigned | getNumLiveBlocks () const |
getNumLiveBlocks - Return the number of blocks where CurLI is live. More... | |
unsigned | countLiveBlocks (const LiveInterval *li) const |
bool | shouldSplitSingleBlock (const BlockInfo &BI, bool SingleInstrs) const |
Public Attributes | |
const MachineFunction & | MF |
const VirtRegMap & | VRM |
const LiveIntervals & | LIS |
const MachineLoopInfo & | Loops |
const TargetInstrInfo & | TII |
SplitAnalysis - Analyze a LiveInterval, looking for live range splitting opportunities.
Definition at line 42 of file SplitKit.h.
typedef SmallPtrSet<const MachineBasicBlock*, 16> llvm::SplitAnalysis::BlockPtrSet |
Definition at line 186 of file SplitKit.h.
SplitAnalysis::SplitAnalysis | ( | const VirtRegMap & | vrm, |
const LiveIntervals & | lis, | ||
const MachineLoopInfo & | mli | ||
) |
Definition at line 42 of file SplitKit.cpp.
void SplitAnalysis::analyze | ( | const LiveInterval * | li | ) |
analyze - set CurLI to the specified interval, and analyze how it may be split.
Definition at line 313 of file SplitKit.cpp.
References clear().
void SplitAnalysis::clear | ( | ) |
clear - clear all data structures so SplitAnalysis is ready to analyze a new interval.
Definition at line 53 of file SplitKit.cpp.
References llvm::BitVector::clear().
Referenced by analyze().
unsigned SplitAnalysis::countLiveBlocks | ( | const LiveInterval * | li | ) | const |
countLiveBlocks - Return the number of blocks where li is live. This is guaranteed to return the same number as getNumLiveBlocks() after calling analyze(li).
Definition at line 276 of file SplitKit.cpp.
References llvm::LiveRange::advanceTo(), llvm::LiveRange::begin(), llvm::LiveRange::empty(), llvm::LiveRange::end(), llvm::LiveIntervals::getMBBEndIdx(), llvm::LiveIntervals::getMBBFromIndex(), and LIS.
|
inline |
didRepairRange() - Returns true if CurLI was invalid and has been repaired by analyze(). This really shouldn't happen, but sometimes the coalescer can create live ranges that end in mid-air.
Definition at line 130 of file SplitKit.h.
getLastSplitPoint - Return the base index of the last valid split point in the basic block numbered Num.
Definition at line 141 of file SplitKit.h.
Referenced by getLastSplitPointIter(), llvm::SplitEditor::splitLiveThroughBlock(), llvm::SplitEditor::splitRegInBlock(), llvm::SplitEditor::splitRegOutBlock(), and llvm::SplitEditor::splitSingleBlock().
MachineBasicBlock::iterator SplitAnalysis::getLastSplitPointIter | ( | MachineBasicBlock * | MBB | ) |
getLastSplitPointIter - Returns the last split point as an iterator.
Definition at line 114 of file SplitKit.cpp.
References llvm::MachineBasicBlock::end(), llvm::LiveIntervals::getInstructionFromIndex(), getLastSplitPoint(), llvm::LiveIntervals::getMBBEndIdx(), llvm::MachineBasicBlock::getNumber(), and LIS.
Referenced by llvm::SplitEditor::enterIntvAtEnd().
|
inline |
getNumLiveBlocks - Return the number of blocks where CurLI is live.
Definition at line 177 of file SplitKit.h.
References getNumThroughBlocks(), and getUseBlocks().
|
inline |
getNumThroughBlocks - Return the number of through blocks.
Definition at line 168 of file SplitKit.h.
Referenced by getNumLiveBlocks().
|
inline |
getParent - Return the last analyzed interval.
Definition at line 137 of file SplitKit.h.
|
inline |
getThroughBlocks - Return the set of through blocks.
Definition at line 174 of file SplitKit.h.
getUseBlocks - Return an array of BlockInfo objects for the basic blocks where CurLI has uses.
Definition at line 165 of file SplitKit.h.
Referenced by getNumLiveBlocks().
getUseSlots - Return an array of SlotIndexes of instructions using CurLI. This include both use and def operands, at most one entry per instruction.
Definition at line 161 of file SplitKit.h.
isOriginalEndpoint - Return true if the original live range was killed or (re-)defined at Idx. Idx should be the 'def' slot for a normal kill/def, and 'use' for an early-clobber def. This can be used to recognize code inserted by earlier live range splitting.
Definition at line 299 of file SplitKit.cpp.
References llvm::LiveRange::begin(), llvm::LiveRange::empty(), llvm::sys::path::end(), llvm::LiveRange::end(), llvm::LiveRange::find(), llvm::LiveIntervals::getInterval(), llvm::VirtRegMap::getOriginal(), I, LIS, llvm::LiveInterval::reg, and VRM.
Referenced by shouldSplitSingleBlock().
isThroughBlock - Return true if CurLI is live through MBB without uses.
Definition at line 171 of file SplitKit.h.
References llvm::BitVector::test().
shouldSplitSingleBlock - Returns true if it would help to create a local live range for the instructions in BI. There is normally no benefit to creating a live range for a single instruction, but it does enable register class inflation if the instruction has a restricted register class.
BI | The block to be isolated. |
SingleInstrs | True when single instructions should be isolated. |
Definition at line 1137 of file SplitKit.cpp.
References llvm::SplitAnalysis::BlockInfo::FirstInstr, llvm::LiveIntervals::getInstructionFromIndex(), llvm::MachineInstr::isCopyLike(), llvm::SplitAnalysis::BlockInfo::isOneInstr(), isOriginalEndpoint(), LIS, llvm::SplitAnalysis::BlockInfo::LiveIn, and llvm::SplitAnalysis::BlockInfo::LiveOut.
const LiveIntervals& llvm::SplitAnalysis::LIS |
Definition at line 46 of file SplitKit.h.
Referenced by countLiveBlocks(), getLastSplitPointIter(), isOriginalEndpoint(), and shouldSplitSingleBlock().
const MachineLoopInfo& llvm::SplitAnalysis::Loops |
Definition at line 47 of file SplitKit.h.
Referenced by llvm::SplitEditor::finish().
const MachineFunction& llvm::SplitAnalysis::MF |
Definition at line 44 of file SplitKit.h.
const TargetInstrInfo& llvm::SplitAnalysis::TII |
Definition at line 48 of file SplitKit.h.
const VirtRegMap& llvm::SplitAnalysis::VRM |
Definition at line 45 of file SplitKit.h.
Referenced by isOriginalEndpoint().