LLVM  5.0.0
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
llvm::SplitAnalysis Class Reference

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

#include "CodeGen/SplitKit.h"

Collaboration diagram for llvm::SplitAnalysis:
[legend]

Classes

struct  BlockInfo
 Additional information about basic blocks where the current variable is live. More...
 

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)
 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)
 

Public Attributes

const MachineFunction & MF
 
const VirtRegMap & VRM
 
const LiveIntervals & LIS
 
const MachineLoopInfo & Loops
 
const TargetInstrInfo & TII
 

Detailed Description

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

Definition at line 77 of file SplitKit.h.

Member Typedef Documentation

Definition at line 203 of file SplitKit.h.

Constructor & Destructor Documentation

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

Definition at line 125 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 330 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 131 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 292 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.

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

SlotIndex llvm::SplitAnalysis::getLastSplitPoint ( unsigned  Num)
inline
MachineBasicBlock::iterator llvm::SplitAnalysis::getLastSplitPointIter ( MachineBasicBlock *  BB)
inline

Definition at line 219 of file SplitKit.h.

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

unsigned llvm::SplitAnalysis::getNumLiveBlocks ( ) const
inline

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

Definition at line 194 of file SplitKit.h.

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

getNumThroughBlocks - Return the number of through blocks.

Definition at line 185 of file SplitKit.h.

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

getParent - Return the last analyzed interval.

Definition at line 167 of file SplitKit.h.

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

getThroughBlocks - Return the set of through blocks.

Definition at line 191 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 182 of file SplitKit.h.

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 178 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 316 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.

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

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 1494 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

const LiveIntervals& llvm::SplitAnalysis::LIS

Definition at line 81 of file SplitKit.h.

Referenced by countLiveBlocks(), isOriginalEndpoint(), and shouldSplitSingleBlock().

const MachineLoopInfo& llvm::SplitAnalysis::Loops

Definition at line 82 of file SplitKit.h.

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

const MachineFunction& llvm::SplitAnalysis::MF

Definition at line 79 of file SplitKit.h.

const TargetInstrInfo& llvm::SplitAnalysis::TII

Definition at line 83 of file SplitKit.h.

const VirtRegMap& llvm::SplitAnalysis::VRM

Definition at line 80 of file SplitKit.h.

Referenced by isOriginalEndpoint().


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