LLVM API Documentation

Classes | Public Types | Public Member Functions
llvm::LiveRangeEdit Class Reference

#include <LiveRangeEdit.h>

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

List of all members.

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.

Public Member Functions

 LiveRangeEdit (LiveInterval *parent, SmallVectorImpl< unsigned > &newRegs, MachineFunction &MF, LiveIntervals &lis, VirtRegMap *vrm, Delegate *delegate=nullptr)
 ~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.
unsigned createFrom (unsigned OldReg)
 createFrom - Create a new virtual register based on OldReg.
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.
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 37 of file LiveRangeEdit.h.


Member Typedef Documentation

Iterator for accessing the new registers added by this edit.

Definition at line 134 of file LiveRangeEdit.h.


Constructor & Destructor Documentation

llvm::LiveRangeEdit::LiveRangeEdit ( LiveInterval parent,
SmallVectorImpl< unsigned > &  newRegs,
MachineFunction MF,
LiveIntervals lis,
VirtRegMap vrm,
Delegate delegate = nullptr 
) [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 115 of file LiveRangeEdit.h.

References llvm::MachineRegisterInfo::setDelegate().

Definition at line 125 of file LiveRangeEdit.h.

References llvm::MachineRegisterInfo::resetDelegate().


Member Function Documentation

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

Definition at line 76 of file LiveRangeEdit.cpp.

References llvm::SmallPtrSetImplBase::empty().

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

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 118 of file LiveRangeEdit.cpp.

References llvm::SmallPtrSetImpl< PtrType >::count(), llvm::VNInfo::def, llvm::LiveIntervals::getInstructionFromIndex(), llvm::LiveIntervals::getInstructionIndex(), llvm::TargetInstrInfo::isAsCheapAsAMove(), llvm::LiveRangeEdit::Remat::OrigMI, and llvm::LiveRangeEdit::Remat::ParentVNI.

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

Definition at line 51 of file LiveRangeEdit.cpp.

References llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::TargetInstrInfo::isTriviallyReMaterializable().

Definition at line 157 of file LiveRangeEdit.h.

References createFrom(), and getReg().

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

Definition at line 153 of file LiveRangeEdit.h.

References createEmptyIntervalFrom(), and getReg().

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

createFrom - Create a new virtual register based on OldReg.

Definition at line 43 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 203 of file LiveRangeEdit.h.

References llvm::SmallPtrSetImpl< PtrType >::count().

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

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

Definition at line 138 of file LiveRangeEdit.h.

References size().

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

iterator llvm::LiveRangeEdit::end ( ) const [inline]

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

Definition at line 161 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 139 of file LiveRangeEdit.h.

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

void llvm::LiveRangeEdit::markRematerialized ( const VNInfo ParentVNI) [inline]

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

Definition at line 198 of file LiveRangeEdit.h.

References llvm::SmallPtrSetImpl< PtrType >::insert().

Definition at line 141 of file LiveRangeEdit.h.

References llvm::makeArrayRef().

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 148 of file LiveRangeEdit.cpp.

References llvm::SlotIndex::getRegSlot(), llvm::LiveIntervals::getSlotIndexes(), llvm::SmallPtrSetImpl< PtrType >::insert(), 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: