LLVM API Documentation

Classes | Public Types | Public Member Functions | Public Attributes
llvm::SplitAnalysis Class Reference

#include <SplitKit.h>

Collaboration diagram for llvm::SplitAnalysis:
Collaboration graph
[legend]

List of all members.

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 LiveIntervalgetParent () const
 getParent - Return the last analyzed interval.
SlotIndex getLastSplitPoint (unsigned Num)
MachineBasicBlock::iterator getLastSplitPointIter (MachineBasicBlock *)
 getLastSplitPointIter - Returns the last split point as an iterator.
bool isOriginalEndpoint (SlotIndex Idx) const
ArrayRef< SlotIndexgetUseSlots () const
ArrayRef< BlockInfogetUseBlocks () const
unsigned getNumThroughBlocks () const
 getNumThroughBlocks - Return the number of through blocks.
bool isThroughBlock (unsigned MBB) const
 isThroughBlock - Return true if CurLI is live through MBB without uses.
const BitVectorgetThroughBlocks () const
 getThroughBlocks - Return the set of through blocks.
unsigned getNumLiveBlocks () const
 getNumLiveBlocks - Return the number of blocks where CurLI is live.
unsigned countLiveBlocks (const LiveInterval *li) const
bool shouldSplitSingleBlock (const BlockInfo &BI, bool SingleInstrs) const

Public Attributes

const MachineFunctionMF
const VirtRegMapVRM
const LiveIntervalsLIS
const MachineLoopInfoLoops
const TargetInstrInfoTII

Detailed Description

SplitAnalysis - Analyze a LiveInterval, looking for live range splitting opportunities.

Definition at line 41 of file SplitKit.h.


Member Typedef Documentation

Definition at line 185 of file SplitKit.h.


Constructor & Destructor Documentation

SplitAnalysis::SplitAnalysis ( const VirtRegMap vrm,
const LiveIntervals lis,
const MachineLoopInfo mli 
)

Definition at line 42 of file SplitKit.cpp.


Member Function Documentation

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(), and llvm::SmallVectorImpl< T >::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::LiveInterval::advanceTo(), llvm::LiveInterval::begin(), llvm::LiveInterval::empty(), llvm::LiveInterval::end(), llvm::LiveIntervals::getMBBEndIdx(), llvm::LiveIntervals::getMBBFromIndex(), LIS, and llvm::LiveRange::start.

bool llvm::SplitAnalysis::didRepairRange ( ) const [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 129 of file SplitKit.h.

SlotIndex llvm::SplitAnalysis::getLastSplitPoint ( unsigned  Num) [inline]

getLastSplitPoint - Return the base index of the last valid split point in the basic block numbered Num.

Definition at line 140 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)
unsigned llvm::SplitAnalysis::getNumLiveBlocks ( ) const [inline]

getNumLiveBlocks - Return the number of blocks where CurLI is live.

Definition at line 176 of file SplitKit.h.

References getNumThroughBlocks(), and getUseBlocks().

unsigned llvm::SplitAnalysis::getNumThroughBlocks ( ) const [inline]

getNumThroughBlocks - Return the number of through blocks.

Definition at line 167 of file SplitKit.h.

Referenced by getNumLiveBlocks().

const LiveInterval& llvm::SplitAnalysis::getParent ( ) const [inline]

getParent - Return the last analyzed interval.

Definition at line 136 of file SplitKit.h.

const BitVector& llvm::SplitAnalysis::getThroughBlocks ( ) const [inline]

getThroughBlocks - Return the set of through blocks.

Definition at line 173 of file SplitKit.h.

ArrayRef<BlockInfo> llvm::SplitAnalysis::getUseBlocks ( ) const [inline]

getUseBlocks - Return an array of BlockInfo objects for the basic blocks where CurLI has uses.

Definition at line 164 of file SplitKit.h.

Referenced by getNumLiveBlocks().

ArrayRef<SlotIndex> llvm::SplitAnalysis::getUseSlots ( ) const [inline]

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 160 of file SplitKit.h.

bool SplitAnalysis::isOriginalEndpoint ( SlotIndex  Idx) const

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::LiveInterval::begin(), llvm::LiveInterval::empty(), llvm::sys::path::end(), llvm::LiveInterval::end(), llvm::LiveInterval::find(), llvm::LiveIntervals::getInterval(), llvm::VirtRegMap::getOriginal(), I, LIS, llvm::LiveInterval::reg, and VRM.

Referenced by shouldSplitSingleBlock().

bool llvm::SplitAnalysis::isThroughBlock ( unsigned  MBB) const [inline]

isThroughBlock - Return true if CurLI is live through MBB without uses.

Definition at line 170 of file SplitKit.h.

References llvm::BitVector::test().

bool SplitAnalysis::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. 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.

Parameters:
BIThe block to be isolated.
SingleInstrsTrue when single instructions should be isolated.

Definition at line 1132 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.


Member Data Documentation

Definition at line 46 of file SplitKit.h.

Referenced by llvm::SplitEditor::finish().

Definition at line 43 of file SplitKit.h.

Definition at line 47 of file SplitKit.h.

Definition at line 44 of file SplitKit.h.

Referenced by isOriginalEndpoint().


The documentation for this class was generated from the following files: