LLVM
8.0.1
|
SplitAnalysis - Analyze a LiveInterval, looking for live range splitting opportunities. More...
#include "CodeGen/SplitKit.h"
Classes | |
struct | BlockInfo |
Additional information about basic blocks where the current variable is live. More... | |
Public Types | |
using | BlockPtrSet = SmallPtrSet< const MachineBasicBlock *, 16 > |
Public Member Functions | |
SplitAnalysis (const VirtRegMap &vrm, const LiveIntervals &lis, const MachineLoopInfo &mli) | |
void | analyze (const LiveInterval *li) |
analyze - set CurLI to the specified interval, and analyze how it may be split. More... | |
bool | didRepairRange () const |
didRepairRange() - Returns true if CurLI was invalid and has been repaired by analyze(). More... | |
void | clear () |
clear - clear all data structures so SplitAnalysis is ready to analyze a new interval. More... | |
const LiveInterval & | getParent () const |
getParent - Return the last analyzed interval. More... | |
bool | isOriginalEndpoint (SlotIndex Idx) const |
isOriginalEndpoint - Return true if the original live range was killed or (re-)defined at Idx. More... | |
ArrayRef< SlotIndex > | getUseSlots () const |
getUseSlots - Return an array of SlotIndexes of instructions using CurLI. More... | |
ArrayRef< BlockInfo > | getUseBlocks () const |
getUseBlocks - Return an array of BlockInfo objects for the basic blocks where CurLI has uses. More... | |
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 |
countLiveBlocks - Return the number of blocks where li is live. More... | |
bool | shouldSplitSingleBlock (const BlockInfo &BI, bool SingleInstrs) const |
shouldSplitSingleBlock - Returns true if it would help to create a local live range for the instructions in BI. More... | |
SlotIndex | getLastSplitPoint (unsigned Num) |
MachineBasicBlock::iterator | getLastSplitPointIter (MachineBasicBlock *BB) |
SlotIndex | getFirstSplitPoint (unsigned Num) |
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 96 of file SplitKit.h.
using llvm::SplitAnalysis::BlockPtrSet = SmallPtrSet<const MachineBasicBlock *, 16> |
Definition at line 222 of file SplitKit.h.
SplitAnalysis::SplitAnalysis | ( | const VirtRegMap & | vrm, |
const LiveIntervals & | lis, | ||
const MachineLoopInfo & | mli | ||
) |
Definition at line 152 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 355 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 157 of file SplitKit.cpp.
References llvm::array_pod_sort(), assert(), llvm::LiveRange::begin(), llvm::BitVector::clear(), llvm::dbgs(), llvm::VNInfo::def, llvm::LiveRange::empty(), llvm::LiveRange::end(), llvm::LiveIntervals::getInstructionIndex(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::LiveIntervals::getMBBFromIndex(), llvm::MachineFunction::getNumBlockIDs(), llvm::MachineFunction::getRegInfo(), llvm::VNInfo::isPHIDef(), llvm::SlotIndex::isSameInstr(), llvm::VNInfo::isUnused(), LIS, LLVM_DEBUG, llvm::SplitAnalysis::BlockInfo::MBB, MF, MRI, llvm::LiveInterval::reg, llvm::BitVector::resize(), llvm::MachineRegisterInfo::use_nodbg_operands(), and llvm::LiveRange::valnos.
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 317 of file SplitKit.cpp.
References llvm::LiveRange::advanceTo(), llvm::LiveRange::begin(), llvm::LiveRange::empty(), llvm::LiveRange::end(), llvm::ilist_node_impl< OptionsT >::getIterator(), 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 179 of file SplitKit.h.
References clear().
Definition at line 242 of file SplitKit.h.
References llvm::MachineFunction::getBlockNumbered(), and llvm::InsertPointAnalysis::getFirstInsertPoint().
Definition at line 234 of file SplitKit.h.
References llvm::MachineFunction::getBlockNumbered(), and llvm::InsertPointAnalysis::getLastInsertPoint().
|
inline |
Definition at line 238 of file SplitKit.h.
References llvm::InsertPointAnalysis::getLastInsertPointIter().
|
inline |
getNumLiveBlocks - Return the number of blocks where CurLI is live.
Definition at line 213 of file SplitKit.h.
|
inline |
getNumThroughBlocks - Return the number of through blocks.
Definition at line 204 of file SplitKit.h.
|
inline |
getParent - Return the last analyzed interval.
Definition at line 186 of file SplitKit.h.
getThroughBlocks - Return the set of through blocks.
Definition at line 210 of file SplitKit.h.
getUseBlocks - Return an array of BlockInfo objects for the basic blocks where CurLI has uses.
Definition at line 201 of file SplitKit.h.
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 197 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 341 of file SplitKit.cpp.
References assert(), 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.
isThroughBlock - Return true if CurLI is live through MBB without uses.
Definition at line 207 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 1556 of file SplitKit.cpp.
References llvm::SplitAnalysis::BlockInfo::FirstInstr, llvm::SplitAnalysis::BlockInfo::isOneInstr(), llvm::SplitAnalysis::BlockInfo::LiveIn, and llvm::SplitAnalysis::BlockInfo::LiveOut.
const LiveIntervals& llvm::SplitAnalysis::LIS |
Definition at line 100 of file SplitKit.h.
Referenced by clear(), countLiveBlocks(), and isOriginalEndpoint().
const MachineLoopInfo& llvm::SplitAnalysis::Loops |
Definition at line 101 of file SplitKit.h.
const MachineFunction& llvm::SplitAnalysis::MF |
Definition at line 98 of file SplitKit.h.
Referenced by clear().
const TargetInstrInfo& llvm::SplitAnalysis::TII |
Definition at line 102 of file SplitKit.h.
const VirtRegMap& llvm::SplitAnalysis::VRM |
Definition at line 99 of file SplitKit.h.
Referenced by isOriginalEndpoint().