LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | List of all members
llvm::LiveRangeEdit Class Reference

#include <LiveRangeEdit.h>

Inheritance diagram for llvm::LiveRangeEdit:
Inheritance graph
[legend]
Collaboration diagram for llvm::LiveRangeEdit:
Collaboration graph
[legend]

Classes

class  Delegate
 Callback methods for LiveRangeEdit owners. More...
 
struct  Remat
 Remat - Information needed to rematerialize at a specific location. More...
 

Public Types

typedef SmallVectorImpl
< unsigned >::const_iterator 
iterator
 Iterator for accessing the new registers added by this edit. More...
 

Public Member Functions

 LiveRangeEdit (LiveInterval *parent, SmallVectorImpl< unsigned > &newRegs, MachineFunction &MF, LiveIntervals &lis, VirtRegMap *vrm, Delegate *delegate=0)
 
 ~LiveRangeEdit ()
 
LiveIntervalgetParent () const
 
unsigned getReg () const
 
iterator begin () const
 
iterator end () const
 
unsigned size () const
 
bool empty () const
 
unsigned get (unsigned idx) const
 
ArrayRef< unsignedregs () const
 
LiveIntervalcreateEmptyIntervalFrom (unsigned OldReg)
 createEmptyIntervalFrom - Create a new empty interval based on OldReg. More...
 
unsigned createFrom (unsigned OldReg)
 createFrom - Create a new virtual register based on OldReg. More...
 
LiveIntervalcreateEmptyInterval ()
 
unsigned create ()
 
bool anyRematerializable (AliasAnalysis *)
 
bool checkRematerializable (VNInfo *VNI, const MachineInstr *DefMI, AliasAnalysis *)
 
bool canRematerializeAt (Remat &RM, SlotIndex UseIdx, bool cheapAsAMove)
 
SlotIndex rematerializeAt (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, const Remat &RM, const TargetRegisterInfo &, bool Late=false)
 
void markRematerialized (const VNInfo *ParentVNI)
 
bool didRematerialize (const VNInfo *ParentVNI) const
 didRematerialize - Return true if ParentVNI was rematerialized anywhere. More...
 
void eraseVirtReg (unsigned Reg)
 
void eliminateDeadDefs (SmallVectorImpl< MachineInstr * > &Dead, ArrayRef< unsigned > RegsBeingSpilled=None)
 
void calculateRegClassAndHint (MachineFunction &, const MachineLoopInfo &, const MachineBlockFrequencyInfo &)
 

Detailed Description

Definition at line 36 of file LiveRangeEdit.h.

Member Typedef Documentation

Iterator for accessing the new registers added by this edit.

Definition at line 136 of file LiveRangeEdit.h.

Constructor & Destructor Documentation

llvm::LiveRangeEdit::LiveRangeEdit ( LiveInterval parent,
SmallVectorImpl< unsigned > &  newRegs,
MachineFunction MF,
LiveIntervals lis,
VirtRegMap vrm,
Delegate delegate = 0 
)
inline

Create a LiveRangeEdit for breaking down parent into smaller pieces.

Parameters
parentThe register being spilled or split.
newRegsList to receive any new registers created. This needn't be empty initially, any existing registers are ignored.
MFThe MachineFunction the live range edit is taking place in.
lisThe collection of all live intervals in this function.
vrmMap of virtual registers to physical registers for this function. If NULL, no virtual register map updates will be done. This could be the case if called before Regalloc.

Definition at line 114 of file LiveRangeEdit.h.

References llvm::MachineRegisterInfo::setDelegate().

llvm::LiveRangeEdit::~LiveRangeEdit ( )
inline

Definition at line 127 of file LiveRangeEdit.h.

References llvm::MachineRegisterInfo::resetDelegate().

Member Function Documentation

bool LiveRangeEdit::anyRematerializable ( AliasAnalysis aa)

anyRematerializable - Return true if any parent values may be rematerializable. This function must be called before any rematerialization is attempted.

Definition at line 75 of file LiveRangeEdit.cpp.

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

iterator llvm::LiveRangeEdit::begin ( ) const
inline
void LiveRangeEdit::calculateRegClassAndHint ( MachineFunction MF,
const MachineLoopInfo Loops,
const MachineBlockFrequencyInfo MBFI 
)
bool LiveRangeEdit::canRematerializeAt ( Remat RM,
SlotIndex  UseIdx,
bool  cheapAsAMove 
)

canRematerializeAt - Determine if ParentVNI can be rematerialized at UseIdx. It is assumed that parent_.getVNINfoAt(UseIdx) == ParentVNI. When cheapAsAMove is set, only cheap remats are allowed.

Definition at line 117 of file LiveRangeEdit.cpp.

References llvm::VNInfo::def, llvm::LiveIntervals::getInstructionFromIndex(), llvm::LiveIntervals::getInstructionIndex(), llvm::MachineInstr::isAsCheapAsAMove(), llvm::LiveRangeEdit::Remat::OrigMI, and llvm::LiveRangeEdit::Remat::ParentVNI.

bool LiveRangeEdit::checkRematerializable ( VNInfo VNI,
const MachineInstr DefMI,
AliasAnalysis aa 
)

checkRematerializable - Manually add VNI to the list of rematerializable values if DefMI may be rematerializable.

Definition at line 50 of file LiveRangeEdit.cpp.

References llvm::TargetInstrInfo::isTriviallyReMaterializable().

unsigned llvm::LiveRangeEdit::create ( )
inline

Definition at line 159 of file LiveRangeEdit.h.

References createFrom(), and getReg().

LiveInterval& llvm::LiveRangeEdit::createEmptyInterval ( )
inline

create - Create a new register with the same class and original slot as parent.

Definition at line 155 of file LiveRangeEdit.h.

References createEmptyIntervalFrom(), and getReg().

Referenced by llvm::SplitEditor::finish(), and llvm::SplitEditor::openIntv().

LiveInterval & LiveRangeEdit::createEmptyIntervalFrom ( unsigned  OldReg)
unsigned LiveRangeEdit::createFrom ( unsigned  OldReg)

createFrom - Create a new virtual register based on OldReg.

Definition at line 42 of file LiveRangeEdit.cpp.

References llvm::MachineRegisterInfo::createVirtualRegister(), llvm::VirtRegMap::getOriginal(), llvm::MachineRegisterInfo::getRegClass(), and llvm::VirtRegMap::setIsSplitFromReg().

Referenced by create().

bool llvm::LiveRangeEdit::didRematerialize ( const VNInfo ParentVNI) const
inline

didRematerialize - Return true if ParentVNI was rematerialized anywhere.

Definition at line 205 of file LiveRangeEdit.h.

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

void LiveRangeEdit::eliminateDeadDefs ( SmallVectorImpl< MachineInstr * > &  Dead,
ArrayRef< unsigned RegsBeingSpilled = None 
)
bool llvm::LiveRangeEdit::empty ( ) const
inline

Definition at line 140 of file LiveRangeEdit.h.

References size().

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

iterator llvm::LiveRangeEdit::end ( ) const
inline
void LiveRangeEdit::eraseVirtReg ( unsigned  Reg)

eraseVirtReg - Notify the delegate that Reg is no longer in use, and try to erase it from LIS.

Definition at line 160 of file LiveRangeEdit.cpp.

References llvm::LiveRangeEdit::Delegate::LRE_CanEraseVirtReg(), and llvm::LiveIntervals::removeInterval().

unsigned llvm::LiveRangeEdit::get ( unsigned  idx) const
inline

Definition at line 141 of file LiveRangeEdit.h.

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

LiveInterval& llvm::LiveRangeEdit::getParent ( ) const
inline
unsigned llvm::LiveRangeEdit::getReg ( ) const
inline
void llvm::LiveRangeEdit::markRematerialized ( const VNInfo ParentVNI)
inline

markRematerialized - explicitly mark a value as rematerialized after doing it manually.

Definition at line 200 of file LiveRangeEdit.h.

ArrayRef<unsigned> llvm::LiveRangeEdit::regs ( ) const
inline

Definition at line 143 of file LiveRangeEdit.h.

References llvm::makeArrayRef().

SlotIndex LiveRangeEdit::rematerializeAt ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
unsigned  DestReg,
const Remat RM,
const TargetRegisterInfo tri,
bool  Late = false 
)

rematerializeAt - Rematerialize RM.ParentVNI into DestReg by inserting an instruction into MBB before MI. The new instruction is mapped, but liveness is not updated. Return the SlotIndex of the new instruction.

Definition at line 147 of file LiveRangeEdit.cpp.

References llvm::SlotIndex::getRegSlot(), llvm::LiveIntervals::getSlotIndexes(), llvm::SlotIndexes::insertMachineInstrInMaps(), llvm::LiveRangeEdit::Remat::OrigMI, llvm::LiveRangeEdit::Remat::ParentVNI, and llvm::TargetInstrInfo::reMaterialize().

unsigned llvm::LiveRangeEdit::size ( ) const
inline

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