LLVM API Documentation

llvm::X86RegisterInfo Class Reference

#include <X86RegisterInfo.h>

Inheritance diagram for llvm::X86RegisterInfo:
[legend]
Collaboration diagram for llvm::X86RegisterInfo:
[legend]

List of all members.

Public Member Functions

 X86RegisterInfo (X86TargetMachine &tm, const TargetInstrInfo &tii)
unsigned getStackAlignment () const
int getDwarfRegNum (unsigned RegNum, bool isEH) const
virtual const TargetRegisterClass * getMatchingSuperRegClass (const TargetRegisterClass *A, const TargetRegisterClass *B, unsigned Idx) const
const TargetRegisterClass * getPointerRegClass (unsigned Kind=0) const
const TargetRegisterClass * getCrossCopyRegClass (const TargetRegisterClass *RC) const
const unsigned * getCalleeSavedRegs (const MachineFunction *MF=0) const
const TargetRegisterClass *const * getCalleeSavedRegClasses (const MachineFunction *MF=0) const
BitVector getReservedRegs (const MachineFunction &MF) const
bool hasFP (const MachineFunction &MF) const
bool needsStackRealignment (const MachineFunction &MF) const
bool hasReservedCallFrame (MachineFunction &MF) const
bool hasReservedSpillSlot (MachineFunction &MF, unsigned Reg, int &FrameIdx) const
void eliminateCallFramePseudoInstr (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const
void eliminateFrameIndex (MachineBasicBlock::iterator MI, int SPAdj, RegScavenger *RS=NULL) const
void processFunctionBeforeCalleeSavedScan (MachineFunction &MF, RegScavenger *RS=NULL) const
void emitCalleeSavedFrameMoves (MachineFunction &MF, unsigned LabelId, unsigned FramePtr) const
void emitPrologue (MachineFunction &MF) const
void emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) const
unsigned getRARegister () const
unsigned getFrameRegister (MachineFunction &MF) const
int getFrameIndexOffset (MachineFunction &MF, int FI) const
void getInitialFrameState (std::vector< MachineMove > &Moves) const
unsigned getEHExceptionRegister () const
unsigned getEHHandlerRegister () const

Static Public Member Functions

static unsigned getX86RegNum (unsigned RegNo)

Public Attributes

X86TargetMachine & TM
const TargetInstrInfo & TII


Detailed Description

Definition at line 50 of file X86RegisterInfo.h.


Constructor & Destructor Documentation

X86RegisterInfo::X86RegisterInfo ( X86TargetMachine &  tm,
const TargetInstrInfo &  tii 
)


Member Function Documentation

unsigned X86RegisterInfo::getX86RegNum ( unsigned  RegNo  )  [static]

getX86RegNum - Returns the native X86 register number for the given LLVM register identifier.

getX86RegNum - This function maps LLVM register identifiers to their X86 specific numbering, which is used in various places encoding instructions.

Definition at line 96 of file X86RegisterInfo.cpp.

References llvm::ARMCC::AL, llvm::XCoreISD::BL, llvm::N86::EAX, llvm::N86::EBP, llvm::N86::EBX, llvm::N86::ECX, llvm::N86::EDI, llvm::N86::EDX, llvm::N86::ESI, llvm::N86::ESP, and llvm_unreachable.

Referenced by getMemModRMByteSize().

unsigned llvm::X86RegisterInfo::getStackAlignment (  )  const [inline]

int X86RegisterInfo::getDwarfRegNum ( unsigned  RegNo,
bool  isEH 
) const

getDwarfRegNum - allows modification of X86GenRegisterInfo::getDwarfRegNum (created by TableGen) for target dependencies.

getDwarfRegNum - This function maps LLVM register identifiers to the DWARF specific numbering, used in debug info and exception tables.

Definition at line 73 of file X86RegisterInfo.cpp.

References llvm::TargetMachine::getSubtarget(), llvm::X86Subtarget::is64Bit(), llvm::X86Subtarget::isTargetCygMing(), llvm::X86Subtarget::isTargetDarwin(), Subtarget, TM, llvm::DWARFFlavour::X86_32_DarwinEH, llvm::DWARFFlavour::X86_32_Generic, and llvm::DWARFFlavour::X86_64.

const TargetRegisterClass * X86RegisterInfo::getMatchingSuperRegClass ( const TargetRegisterClass *  A,
const TargetRegisterClass *  B,
unsigned  Idx 
) const [virtual]

Code Generation virtual methods... getMatchingSuperRegClass - Return a subclass of the specified register class A so that each register in it has a sub-register of the specified sub-register index which is in the specified register class B.

Definition at line 157 of file X86RegisterInfo.cpp.

References llvm::TargetRegisterClass::getSize().

const TargetRegisterClass * X86RegisterInfo::getPointerRegClass ( unsigned  Kind = 0  )  const

getPointerRegClass - Returns a TargetRegisterClass used for pointer values.

Definition at line 264 of file X86RegisterInfo.cpp.

References llvm::TargetMachine::getSubtarget(), llvm_unreachable, and TM.

const TargetRegisterClass * X86RegisterInfo::getCrossCopyRegClass ( const TargetRegisterClass *  RC  )  const

getCrossCopyRegClass - Returns a legal register class to copy a register in the specified class to or from. Returns NULL if it is possible to copy between a two registers of the specified class.

Definition at line 279 of file X86RegisterInfo.cpp.

const unsigned * X86RegisterInfo::getCalleeSavedRegs ( const MachineFunction *  MF = 0  )  const

getCalleeSavedRegs - Return a null-terminated list of all of the callee-save registers on this target.

Definition at line 290 of file X86RegisterInfo.cpp.

References llvm::MachineModuleInfo::callsEHReturn(), llvm::N86::EAX, llvm::N86::EBP, llvm::N86::EBX, llvm::N86::EDI, llvm::N86::EDX, llvm::N86::ESI, llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getMachineModuleInfo(), MFI, and MMI.

const TargetRegisterClass *const * X86RegisterInfo::getCalleeSavedRegClasses ( const MachineFunction *  MF = 0  )  const

getCalleeSavedRegClasses - Return a null-terminated list of the preferred register classes to spill each callee-saved register with. The order and length of this list match the getCalleeSavedRegs() list.

Definition at line 335 of file X86RegisterInfo.cpp.

References llvm::MachineModuleInfo::callsEHReturn(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getMachineModuleInfo(), MFI, and MMI.

BitVector X86RegisterInfo::getReservedRegs ( const MachineFunction &  MF  )  const

getReservedRegs - Returns a bitset indexed by physical register number indicating if a register is a special register that has particular uses and should be considered unavailable at all times, e.g. SP, RA. This is used by register scavenger to determine what registers are free.

Definition at line 388 of file X86RegisterInfo.cpp.

References llvm::N86::EBP, llvm::N86::ESP, hasFP(), and llvm::BitVector::set().

bool X86RegisterInfo::hasFP ( const MachineFunction &  MF  )  const

bool X86RegisterInfo::needsStackRealignment ( const MachineFunction &  MF  )  const

bool X86RegisterInfo::hasReservedCallFrame ( MachineFunction &  MF  )  const

bool X86RegisterInfo::hasReservedSpillSlot ( MachineFunction &  MF,
unsigned  Reg,
int &  FrameIdx 
) const

void X86RegisterInfo::eliminateCallFramePseudoInstr ( MachineFunction &  MF,
MachineBasicBlock &  MBB,
MachineBasicBlock::iterator  MI 
) const

void X86RegisterInfo::eliminateFrameIndex ( MachineBasicBlock::iterator  MI,
int  SPAdj,
RegScavenger *  RS = NULL 
) const

void X86RegisterInfo::processFunctionBeforeCalleeSavedScan ( MachineFunction &  MF,
RegScavenger *  RS = NULL 
) const

void X86RegisterInfo::emitCalleeSavedFrameMoves ( MachineFunction &  MF,
unsigned  LabelId,
unsigned  FramePtr 
) const

void X86RegisterInfo::emitPrologue ( MachineFunction &  MF  )  const

emitPrologue - Push callee-saved registers onto the stack, which automatically adjust the stack pointer. Adjust the stack pointer to allocate space for local variables. Also emit labels used by the exception handler to generate the exception handling frames.

Definition at line 857 of file X86RegisterInfo.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::addRegOffset(), llvm::ARMCC::AL, llvm::MachineFunction::begin(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::ISD::DBG_LABEL, llvm::Function::doesNotThrow(), E, llvm::N86::EAX, emitCalleeSavedFrameMoves(), emitSPUpdate(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::MachineFunction::front(), llvm::TargetInstrInfo::get(), llvm::X86MachineFunctionInfo::getCalleeSavedFrameSize(), llvm::TargetMachine::getFrameInfo(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineFrameInfo::getMachineModuleInfo(), llvm::MachineFrameInfo::getMaxAlignment(), llvm::MachineInstr::getOperand(), llvm::TargetData::getPointerSize(), llvm::MachineFunction::getRegInfo(), llvm::TargetFrameInfo::getStackGrowthDirection(), llvm::MachineFrameInfo::getStackSize(), llvm::TargetMachine::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::TargetMachine::getTargetData(), llvm::X86MachineFunctionInfo::getTCReturnAddrDelta(), llvm::MachineFrameInfo::hasCalls(), llvm::Function::hasFnAttr(), hasFP(), llvm::MachineFrameInfo::hasVarSizedObjects(), II, llvm::MachineBasicBlock::insert(), llvm::X86Subtarget::isTargetCygMing(), llvm::X86Subtarget::isTargetWin64(), llvm::RegState::Kill, llvm::MachineRegisterInfo::livein_begin(), llvm::MachineRegisterInfo::livein_end(), MBB, MBBI, mergeSPUpdates(), mergeSPUpdatesDown(), MFI, MI, MMI, needsStackRealignment(), llvm::next(), llvm::Attribute::NoRedZone, Reg, llvm::X86MachineFunctionInfo::setCalleeSavedFrameSize(), llvm::MachineOperand::setIsDead(), llvm::MachineFrameInfo::setOffsetAdjustment(), llvm::MachineFrameInfo::setStackSize(), llvm::TargetFrameInfo::StackGrowsUp, Subtarget, TD, TII, llvm::UnwindTablesMandatory, and llvm::MachineLocation::VirtualFP.

void X86RegisterInfo::emitEpilogue ( MachineFunction &  MF,
MachineBasicBlock &  MBB 
) const

unsigned X86RegisterInfo::getRARegister (  )  const

Definition at line 1267 of file X86RegisterInfo.cpp.

Referenced by getInitialFrameState().

unsigned X86RegisterInfo::getFrameRegister ( MachineFunction &  MF  )  const

int X86RegisterInfo::getFrameIndexOffset ( MachineFunction &  MF,
int  FI 
) const

void X86RegisterInfo::getInitialFrameState ( std::vector< MachineMove > &  Moves  )  const

Definition at line 1277 of file X86RegisterInfo.cpp.

References getRARegister(), Src, and llvm::MachineLocation::VirtualFP.

unsigned X86RegisterInfo::getEHExceptionRegister (  )  const

Definition at line 1292 of file X86RegisterInfo.cpp.

References llvm_unreachable.

unsigned X86RegisterInfo::getEHHandlerRegister (  )  const

Definition at line 1297 of file X86RegisterInfo.cpp.

References llvm_unreachable.


Member Data Documentation

Definition at line 52 of file X86RegisterInfo.h.

Referenced by getDwarfRegNum(), getPointerRegClass(), and X86RegisterInfo().

Definition at line 53 of file X86RegisterInfo.h.

Referenced by eliminateCallFramePseudoInstr(), emitEpilogue(), and emitPrologue().


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