LLVM API Documentation

Classes | Public Member Functions
llvm::RegScavenger Class Reference

#include <RegisterScavenging.h>

List of all members.

Classes

struct  ScavengedInfo
 Information on scavenged registers (held in a spill slot).

Public Member Functions

 RegScavenger ()
void enterBasicBlock (MachineBasicBlock *mbb)
void initRegState ()
void forward ()
 forward - Move the internal MBB iterator and update register states.
void forward (MachineBasicBlock::iterator I)
void unprocess ()
void unprocess (MachineBasicBlock::iterator I)
 Unprocess instructions until you reach the provided iterator.
void skipTo (MachineBasicBlock::iterator I)
 skipTo - Move the internal MBB iterator but do not update register states.
MachineBasicBlock::iterator getCurrentPosition () const
bool isRegUsed (unsigned Reg, bool includeReserved=true) const
 isRegUsed - return if a specific register is currently used.
BitVector getRegsAvailable (const TargetRegisterClass *RC)
unsigned FindUnusedReg (const TargetRegisterClass *RegClass) const
void addScavengingFrameIndex (int FI)
 Add a scavenging frame index.
bool isScavengingFrameIndex (int FI) const
 Query whether a frame index is a scavenging frame index.
void getScavengingFrameIndices (SmallVectorImpl< int > &A) const
 Get an array of scavenging frame indices.
unsigned scavengeRegister (const TargetRegisterClass *RegClass, MachineBasicBlock::iterator I, int SPAdj)
unsigned scavengeRegister (const TargetRegisterClass *RegClass, int SPAdj)
void setRegUsed (unsigned Reg)
 setUsed - Set the register units of this register as used.

Detailed Description

Definition at line 31 of file RegisterScavenging.h.


Constructor & Destructor Documentation

Definition at line 72 of file RegisterScavenging.h.


Member Function Documentation

FindUnusedReg - Find a unused register of the specified register class. Return 0 if none is found.

Definition at line 266 of file RegisterScavenging.cpp.

References llvm::TargetRegisterClass::begin(), llvm::dbgs(), DEBUG, llvm::TargetRegisterClass::end(), llvm::MCRegisterInfo::getName(), I, and isRegUsed().

forward - Move the internal MBB iterator and update register states until it has processed the specific iterator.

Definition at line 88 of file RegisterScavenging.h.

References llvm::MachineBasicBlock::begin(), forward(), and I.

Definition at line 109 of file RegisterScavenging.h.

getRegsAvailable - Return all available registers in the register class in Mask.

Definition at line 279 of file RegisterScavenging.cpp.

References llvm::TargetRegisterClass::begin(), llvm::TargetRegisterClass::end(), llvm::MCRegisterInfo::getNumRegs(), I, isRegUsed(), and llvm::BitVector::set().

Referenced by llvm::Mips16InstrInfo::loadImmediate(), and scavengeRegister().

bool RegScavenger::isRegUsed ( unsigned  Reg,
bool  includeReserved = true 
) const

isRegUsed - return if a specific register is currently used.

Definition at line 257 of file RegisterScavenging.cpp.

References llvm::MCRegisterInfo::DiffListIterator::isValid(), and llvm::BitVector::test().

Referenced by FindUnusedReg(), forward(), getRegsAvailable(), and scavengeRegister().

Definition at line 153 of file RegisterScavenging.h.

References scavengeRegister().

setUsed - Set the register units of this register as used.

setRegUsed - Tell the scavenger a register is used.

Definition at line 35 of file RegisterScavenging.cpp.

References llvm::MCRegisterInfo::DiffListIterator::isValid(), and llvm::BitVector::reset().

Referenced by initRegState(), InsertFPConstInst(), and InsertSPConstInst().

skipTo - Move the internal MBB iterator but do not update register states.

Definition at line 103 of file RegisterScavenging.h.

References I.

Invert the behavior of forward() on the current instruction (undo the changes to the available registers made by forward()).

Definition at line 152 of file RegisterScavenging.cpp.

References llvm::MachineBasicBlock::begin(), and llvm::MachineInstr::isDebugValue().

Referenced by unprocess().

Unprocess instructions until you reach the provided iterator.

Definition at line 98 of file RegisterScavenging.h.

References unprocess().


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