LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::SparcV9RegInfo Class Reference

#include <SparcV9RegInfo.h>

Collaboration diagram for llvm::SparcV9RegInfo:

Collaboration graph
[legend]
List of all members.

Public Types

enum  RegTypes {
  IntRegType, FPSingleRegType, FPDoubleRegType, IntCCRegType,
  FloatCCRegType, SpecialRegType
}
enum  RegClassIDs {
  IntRegClassID, FloatRegClassID, IntCCRegClassID, FloatCCRegClassID,
  SpecialRegClassID
}

Public Member Functions

unsigned getRegClassIDOfType (const Type *type, bool isCCReg=false) const
unsigned getRegClassIDOfRegType (int regType) const
unsigned getRegClassIDOfReg (int unifiedRegNum) const
unsigned int getNumOfRegClasses () const
const TargetRegClassInfogetMachineRegClass (unsigned i) const
unsigned getZeroRegNum () const
void suggestRegs4MethodArgs (const Function *Func, LiveRangeInfo &LRI) const
void suggestRegs4CallArgs (MachineInstr *CallI, LiveRangeInfo &LRI) const
void suggestReg4RetValue (MachineInstr *RetI, LiveRangeInfo &LRI) const
void colorMethodArgs (const Function *Func, LiveRangeInfo &LRI, std::vector< MachineInstr * > &InstrnsBefore, std::vector< MachineInstr * > &InstrnsAfter) const
bool isRegVolatile (int RegClassID, int Reg) const
bool modifiedByCall (int RegClassID, int Reg) const
unsigned getCallAddressReg () const
int getUnifiedRegNum (unsigned regClassID, int reg) const
int getClassRegNum (int uRegNum, unsigned &regClassID) const
const char *const getUnifiedRegName (int UnifiedRegNum) const
int getSpilledRegSize (int RegType) const
 SparcV9RegInfo (const SparcV9TargetMachine &tgt)
 ~SparcV9RegInfo ()
unsigned getReturnAddressReg () const
unsigned const getNumOfIntArgRegs () const
unsigned const getNumOfFloatArgRegs () const
int regNumForIntArg (bool inCallee, bool isVarArgsCall, unsigned argNo, unsigned &regClassId) const
int regNumForFPArg (unsigned RegType, bool inCallee, bool isVarArgsCall, unsigned argNo, unsigned &regClassId) const
void printReg (const LiveRange *LR) const
const ValuegetCallInstRetVal (const MachineInstr *CallMI) const
const ValuegetCallInstIndirectAddrVal (const MachineInstr *CallMI) const
bool regTypeNeedsScratchReg (int RegType, int &scratchRegClassId) const
void cpReg2RegMI (std::vector< MachineInstr * > &mvec, unsigned SrcReg, unsigned DestReg, int RegType) const
void cpReg2MemMI (std::vector< MachineInstr * > &mvec, unsigned SrcReg, unsigned DestPtrReg, int Offset, int RegType, int scratchReg=-1) const
void cpMem2RegMI (std::vector< MachineInstr * > &mvec, unsigned SrcPtrReg, int Offset, unsigned DestReg, int RegType, int scratchReg=-1) const
void cpValue2Value (Value *Src, Value *Dest, std::vector< MachineInstr * > &mvec) const
int getRegTypeForDataType (const Type *type) const
int getRegTypeForLR (const LiveRange *LR) const
int getRegType (int unifiedRegNum) const
unsigned getFramePointer () const
unsigned getStackPointer () const

Static Public Member Functions

static int getInvalidRegNum ()

Public Attributes

const TargetMachinetarget

Protected Attributes

std::vector< const TargetRegClassInfo * > MachineRegClassArr

Detailed Description

SparcV9RegInfo - Interface to register info of SparcV9 target machine

Definition at line 104 of file SparcV9RegInfo.h.


Member Enumeration Documentation

enum llvm::SparcV9RegInfo::RegClassIDs
 

Enumerator:
IntRegClassID 
FloatRegClassID 
IntCCRegClassID 
FloatCCRegClassID 
SpecialRegClassID 

Definition at line 287 of file SparcV9RegInfo.h.

enum llvm::SparcV9RegInfo::RegTypes
 

Enumerator:
IntRegType 
FPSingleRegType 
FPDoubleRegType 
IntCCRegType 
FloatCCRegType 
SpecialRegType 

Definition at line 272 of file SparcV9RegInfo.h.


Constructor & Destructor Documentation

llvm::SparcV9RegInfo::SparcV9RegInfo const SparcV9TargetMachine tgt  ) 
 

Definition at line 39 of file SparcV9RegInfo.cpp.

References FloatCCRegClassID, FloatRegClassID, IntCCRegClassID, IntRegClassID, MachineRegClassArr, SpecialRegClassID, and llvm::SparcV9FloatRegClass::StartOfNonVolatileRegs.

llvm::SparcV9RegInfo::~SparcV9RegInfo  )  [inline]
 

Definition at line 297 of file SparcV9RegInfo.h.

References MachineRegClassArr.


Member Function Documentation

void llvm::SparcV9RegInfo::colorMethodArgs const Function Func,
LiveRangeInfo LRI,
std::vector< MachineInstr * > &  InstrnsBefore,
std::vector< MachineInstr * > &  InstrnsAfter
const
 

Definition at line 401 of file SparcV9RegInfo.cpp.

References llvm::Function::abegin(), llvm::Function::aend(), llvm::BadRegClass, cpMem2RegMI(), cpReg2MemMI(), cpReg2RegMI(), E, FloatRegClassID, FPSingleRegType, llvm::MachineFunction::get(), llvm::TargetMachine::getFrameInfo(), getFramePointer(), llvm::TargetFrameInfo::getIncomingArgOffset(), llvm::MachineFunction::getInfo(), getInvalidRegNum(), llvm::LiveRangeInfo::getLiveRangeForValue(), getRegTypeForLR(), getSpilledRegSize(), llvm::TargetMachine::getTargetData(), llvm::GlobalValue::getType(), llvm::TargetData::getTypeSize(), getUnifiedRegNum(), I, IntRegClassID, IntRegType, llvm::isVarArgsFunction(), regNumForFPArg(), regNumForIntArg(), llvm::SparcV9FrameInfo::SizeOfEachArgOnStack, and target.

void llvm::SparcV9RegInfo::cpMem2RegMI std::vector< MachineInstr * > &  mvec,
unsigned  PtrReg,
int  Offset,
unsigned  DestReg,
int  RegType,
int  scratchReg = -1
const
 

cpMem2RegMI - Generate SparcV9 MachineInstrs to load a register (DestReg) from memory, at [PtrReg + Offset]. Register numbers must be the unified register numbers. RegType must be the SparcV9 register type of DestReg. When DestReg is ccr, scratchReg must be the number of a free integer register. The newly-generated MachineInstrs are appended to mvec.

Definition at line 836 of file SparcV9RegInfo.cpp.

References llvm::MachineInstrBuilder::addMReg(), llvm::MachineInstrBuilder::addSImm(), llvm::MachineInstrBuilder::addZImm(), llvm::BuildMI(), llvm::SparcV9::ccr, llvm::TargetInstrInfo::constantFitsInImmedField(), llvm::MachineOperand::Def, FloatCCRegType, FPDoubleRegType, FPSingleRegType, llvm::SparcV9::fsr, llvm::SparcV9::g0, llvm::SparcV9::g4, llvm::TargetMachine::getInstrInfo(), llvm::MachineInstr::getOperand(), getRegType(), IntCCRegType, IntRegType, llvm::MachineOperand::markHi32(), llvm::MachineOperand::markLo32(), SpecialRegType, and target.

Referenced by colorMethodArgs().

void llvm::SparcV9RegInfo::cpReg2MemMI std::vector< MachineInstr * > &  mvec,
unsigned  SrcReg,
unsigned  PtrReg,
int  Offset,
int  RegType,
int  scratchReg = -1
const
 

cpReg2MemMI - Generate SparcV9 MachineInstrs to store a register (SrcReg) to memory, at [PtrReg + Offset]. Register numbers must be the unified register numbers. RegType must be the SparcV9 register type of SrcReg. When SrcReg is ccr, scratchReg must be the number of a free integer register. The newly-generated MachineInstrs are appended to mvec.

Definition at line 754 of file SparcV9RegInfo.cpp.

References llvm::MachineInstrBuilder::addMReg(), llvm::MachineInstrBuilder::addSImm(), llvm::MachineInstrBuilder::addZImm(), llvm::BuildMI(), llvm::SparcV9::ccr, llvm::TargetInstrInfo::constantFitsInImmedField(), llvm::MachineOperand::Def, FloatCCRegType, FPDoubleRegType, FPSingleRegType, llvm::SparcV9::fsr, llvm::SparcV9::g4, llvm::TargetMachine::getInstrInfo(), llvm::MachineInstr::getOperand(), getRegType(), IntCCRegType, IntRegType, llvm::MachineOperand::markHi32(), llvm::MachineOperand::markLo32(), SpecialRegType, and target.

Referenced by colorMethodArgs().

void llvm::SparcV9RegInfo::cpReg2RegMI std::vector< MachineInstr * > &  mvec,
unsigned  SrcReg,
unsigned  DestReg,
int  RegType
const
 

Definition at line 687 of file SparcV9RegInfo.cpp.

References llvm::MachineInstrBuilder::addMReg(), llvm::BuildMI(), llvm::SparcV9IntCCRegClass::ccr, llvm::MachineOperand::Def, FloatCCRegType, FPDoubleRegType, FPSingleRegType, llvm::SparcV9IntRegClass::g0, getInvalidRegNum(), getRegType(), getUnifiedRegNum(), getZeroRegNum(), IntCCRegClassID, IntCCRegType, and IntRegType.

Referenced by colorMethodArgs().

void llvm::SparcV9RegInfo::cpValue2Value Value Src,
Value Dest,
std::vector< MachineInstr * > &  mvec
const
 

Definition at line 922 of file SparcV9RegInfo.cpp.

References llvm::MachineInstrBuilder::addMReg(), llvm::MachineInstrBuilder::addReg(), llvm::MachineInstrBuilder::addRegDef(), llvm::BuildMI(), FPDoubleRegType, FPSingleRegType, getRegTypeForDataType(), llvm::Value::getType(), getZeroRegNum(), and IntRegType.

unsigned llvm::SparcV9RegInfo::getCallAddressReg  )  const
 

Definition at line 64 of file SparcV9RegInfo.cpp.

References getUnifiedRegNum(), IntRegClassID, and llvm::SparcV9IntRegClass::o7.

const Value* llvm::SparcV9RegInfo::getCallInstIndirectAddrVal const MachineInstr CallMI  )  const
 

const Value* llvm::SparcV9RegInfo::getCallInstRetVal const MachineInstr CallMI  )  const
 

int llvm::SparcV9RegInfo::getClassRegNum int  uRegNum,
unsigned &  regClassID
const [inline]
 

Definition at line 208 of file SparcV9RegInfo.h.

References getInvalidRegNum(), getNumOfRegClasses(), and MachineRegClassArr.

Referenced by llvm::LiveRangeInfo::constructLiveRanges(), getRegClassIDOfReg(), getUnifiedRegName(), and llvm::markRegisterUsed().

unsigned llvm::SparcV9RegInfo::getFramePointer  )  const
 

Definition at line 138 of file SparcV9RegInfo.cpp.

References getUnifiedRegNum(), llvm::SparcV9IntRegClass::i6, and IntRegClassID.

Referenced by colorMethodArgs().

static int llvm::SparcV9RegInfo::getInvalidRegNum  )  [inline, static]
 

Definition at line 118 of file SparcV9RegInfo.h.

Referenced by colorMethodArgs(), cpReg2RegMI(), getClassRegNum(), getUnifiedRegNum(), regNumForFPArg(), regNumForIntArg(), suggestRegs4CallArgs(), and suggestRegs4MethodArgs().

const TargetRegClassInfo* llvm::SparcV9RegInfo::getMachineRegClass unsigned  i  )  const [inline]
 

Definition at line 146 of file SparcV9RegInfo.h.

References MachineRegClassArr.

Referenced by llvm::PhyRegAlloc::runOnFunction().

unsigned const llvm::SparcV9RegInfo::getNumOfFloatArgRegs  )  const [inline]
 

Definition at line 312 of file SparcV9RegInfo.h.

unsigned const llvm::SparcV9RegInfo::getNumOfIntArgRegs  )  const [inline]
 

Definition at line 311 of file SparcV9RegInfo.h.

unsigned int llvm::SparcV9RegInfo::getNumOfRegClasses  )  const [inline]
 

Definition at line 142 of file SparcV9RegInfo.h.

References MachineRegClassArr.

Referenced by getClassRegNum(), getUnifiedRegName(), and getUnifiedRegNum().

unsigned llvm::SparcV9RegInfo::getRegClassIDOfReg int  unifiedRegNum  )  const [inline]
 

Definition at line 136 of file SparcV9RegInfo.h.

References getClassRegNum().

unsigned llvm::SparcV9RegInfo::getRegClassIDOfRegType int  regType  )  const
 

Definition at line 297 of file SparcV9RegInfo.cpp.

References FloatCCRegClassID, FloatCCRegType, FloatRegClassID, FPDoubleRegType, FPSingleRegType, IntCCRegClassID, IntCCRegType, IntRegClassID, IntRegType, SpecialRegClassID, and SpecialRegType.

unsigned llvm::SparcV9RegInfo::getRegClassIDOfType const Type type,
bool  isCCReg = false
const
 

Definition at line 274 of file SparcV9RegInfo.cpp.

References llvm::Type::DoubleTyID, FloatRegClassID, llvm::Type::FunctionTyID, llvm::Type::getTypeID(), IntRegClassID, llvm::Type::LabelTyID, llvm::Type::LongTyID, and llvm::Type::PointerTyID.

Referenced by getRegTypeForDataType().

int llvm::SparcV9RegInfo::getRegType int  unifiedRegNum  )  const
 

Definition at line 252 of file SparcV9RegInfo.cpp.

References FloatCCRegType, FPDoubleRegType, FPSingleRegType, IntCCRegType, IntRegType, and SpecialRegType.

Referenced by cpMem2RegMI(), cpReg2MemMI(), and cpReg2RegMI().

int llvm::SparcV9RegInfo::getRegTypeForDataType const Type type  )  const
 

Definition at line 242 of file SparcV9RegInfo.cpp.

References getRegClassIDOfType().

Referenced by cpValue2Value().

int llvm::SparcV9RegInfo::getRegTypeForLR const LiveRange LR  )  const
 

Definition at line 247 of file SparcV9RegInfo.cpp.

Referenced by llvm::LiveRangeInfo::coalesceLRs(), colorMethodArgs(), suggestRegs4CallArgs(), and suggestRegs4MethodArgs().

unsigned llvm::SparcV9RegInfo::getReturnAddressReg  )  const
 

Definition at line 73 of file SparcV9RegInfo.cpp.

References getUnifiedRegNum(), llvm::SparcV9IntRegClass::i7, and IntRegClassID.

int llvm::SparcV9RegInfo::getSpilledRegSize int  RegType  )  const [inline]
 

Definition at line 242 of file SparcV9RegInfo.h.

Referenced by colorMethodArgs().

unsigned llvm::SparcV9RegInfo::getStackPointer  )  const
 

Definition at line 144 of file SparcV9RegInfo.cpp.

References getUnifiedRegNum(), IntRegClassID, and llvm::SparcV9IntRegClass::o6.

const char* const llvm::SparcV9RegInfo::getUnifiedRegName int  UnifiedRegNum  )  const [inline]
 

Definition at line 228 of file SparcV9RegInfo.h.

References getClassRegNum(), getNumOfRegClasses(), and MachineRegClassArr.

Referenced by printReg().

int llvm::SparcV9RegInfo::getUnifiedRegNum unsigned  regClassID,
int  reg
const [inline]
 

Definition at line 197 of file SparcV9RegInfo.h.

References getInvalidRegNum(), getNumOfRegClasses(), and MachineRegClassArr.

Referenced by colorMethodArgs(), cpReg2RegMI(), getCallAddressReg(), getFramePointer(), getReturnAddressReg(), getStackPointer(), getZeroRegNum(), and printReg().

unsigned llvm::SparcV9RegInfo::getZeroRegNum  )  const
 

Definition at line 56 of file SparcV9RegInfo.cpp.

References llvm::SparcV9IntRegClass::g0, getUnifiedRegNum(), and IntRegClassID.

Referenced by cpReg2RegMI(), cpValue2Value(), and llvm::IsUselessCopy().

bool llvm::SparcV9RegInfo::isRegVolatile int  RegClassID,
int  Reg
const [inline]
 

Definition at line 176 of file SparcV9RegInfo.h.

References MachineRegClassArr.

bool llvm::SparcV9RegInfo::modifiedByCall int  RegClassID,
int  Reg
const [inline]
 

Definition at line 182 of file SparcV9RegInfo.h.

References MachineRegClassArr.

void llvm::SparcV9RegInfo::printReg const LiveRange LR  )  const
 

Definition at line 951 of file SparcV9RegInfo.cpp.

References llvm::Type::DoubleTy, FloatRegClassID, getUnifiedRegName(), and getUnifiedRegNum().

int llvm::SparcV9RegInfo::regNumForFPArg unsigned  RegType,
bool  inCallee,
bool  isVarArgsCall,
unsigned  argNo,
unsigned &  regClassId
const
 

Definition at line 197 of file SparcV9RegInfo.cpp.

References llvm::SparcV9FloatRegClass::f0, FloatRegClassID, FPDoubleRegType, FPSingleRegType, getInvalidRegNum(), and regNumForIntArg().

Referenced by colorMethodArgs(), suggestRegs4CallArgs(), and suggestRegs4MethodArgs().

int llvm::SparcV9RegInfo::regNumForIntArg bool  inCallee,
bool  isVarArgsCall,
unsigned  argNo,
unsigned &  regClassId
const
 

Definition at line 178 of file SparcV9RegInfo.cpp.

References getInvalidRegNum(), llvm::SparcV9IntRegClass::i0, IntRegClassID, and llvm::SparcV9IntRegClass::o0.

Referenced by colorMethodArgs(), regNumForFPArg(), suggestRegs4CallArgs(), and suggestRegs4MethodArgs().

bool llvm::SparcV9RegInfo::regTypeNeedsScratchReg int  RegType,
int &  scratchRegClassId
const
 

Definition at line 670 of file SparcV9RegInfo.cpp.

References IntCCRegType, and IntRegType.

void llvm::SparcV9RegInfo::suggestReg4RetValue MachineInstr RetI,
LiveRangeInfo LRI
const
 

Definition at line 642 of file SparcV9RegInfo.cpp.

References llvm::SparcV9FloatRegClass::f0, llvm::TargetMachine::getInstrInfo(), llvm::LiveRangeInfo::getLiveRangeForValue(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::ReturnInst::getReturnValue(), llvm::MachineOperand::getVRegValue(), llvm::SparcV9IntRegClass::i0, IntRegClassID, llvm::TargetInstrInfo::isReturn(), and target.

void llvm::SparcV9RegInfo::suggestRegs4CallArgs MachineInstr CallI,
LiveRangeInfo LRI
const
 

Definition at line 574 of file SparcV9RegInfo.cpp.

References llvm::BadRegClass, llvm::SparcV9FloatRegClass::f0, FloatRegClassID, llvm::CallArgsDescriptor::get(), llvm::CallArgsDescriptor::getArgInfo(), llvm::CallArgInfo::getArgVal(), llvm::TargetMachine::getInstrInfo(), getInvalidRegNum(), llvm::LiveRangeInfo::getLiveRangeForValue(), llvm::CallArgsDescriptor::getNumArgs(), llvm::MachineInstr::getOpcode(), getRegTypeForLR(), llvm::CallArgsDescriptor::getReturnValue(), IntRegClassID, IntRegType, llvm::SparcV9IntRegClass::o0, regNumForFPArg(), regNumForIntArg(), and target.

void llvm::SparcV9RegInfo::suggestRegs4MethodArgs const Function Func,
LiveRangeInfo LRI
const
 

Definition at line 368 of file SparcV9RegInfo.cpp.

References llvm::Function::abegin(), llvm::Function::aend(), llvm::BadRegClass, E, getInvalidRegNum(), llvm::LiveRangeInfo::getLiveRangeForValue(), getRegTypeForLR(), llvm::GlobalValue::getType(), I, IntRegType, llvm::isVarArgsFunction(), regNumForFPArg(), and regNumForIntArg().

Referenced by llvm::LiveRangeInfo::constructLiveRanges().


Member Data Documentation

std::vector<const TargetRegClassInfo *> llvm::SparcV9RegInfo::MachineRegClassArr [protected]
 

Definition at line 110 of file SparcV9RegInfo.h.

Referenced by getClassRegNum(), getMachineRegClass(), getNumOfRegClasses(), getUnifiedRegName(), getUnifiedRegNum(), isRegVolatile(), modifiedByCall(), SparcV9RegInfo(), and ~SparcV9RegInfo().

const TargetMachine& llvm::SparcV9RegInfo::target
 

Definition at line 113 of file SparcV9RegInfo.h.

Referenced by colorMethodArgs(), cpMem2RegMI(), cpReg2MemMI(), suggestReg4RetValue(), and suggestRegs4CallArgs().


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