LLVM API Documentation
#include <TargetRegisterInfo.h>

Definition at line 239 of file TargetRegisterInfo.h.
| typedef const TargetRegisterClass* const* llvm::TargetRegisterInfo::regclass_iterator |
Definition at line 244 of file TargetRegisterInfo.h.
| anonymous enum |
Definition at line 263 of file TargetRegisterInfo.h.
| TargetRegisterInfo::TargetRegisterInfo | ( | const TargetRegisterDesc * | D, | |
| unsigned | NR, | |||
| regclass_iterator | RegClassBegin, | |||
| regclass_iterator | RegClassEnd, | |||
| int | CallFrameSetupOpcode = -1, |
|||
| int | CallFrameDestroyOpcode = -1, |
|||
| const unsigned * | subregs = 0, |
|||
| const unsigned | subregsize = 0 | |||
| ) | [protected] |
| TargetRegisterInfo::~TargetRegisterInfo | ( | ) | [protected, virtual] |
Definition at line 36 of file TargetRegisterInfo.cpp.
| static bool llvm::TargetRegisterInfo::isPhysicalRegister | ( | unsigned | Reg | ) | [inline, static] |
isPhysicalRegister - Return true if the specified register number is in the physical register namespace.
Definition at line 277 of file TargetRegisterInfo.h.
References FirstVirtualRegister.
Referenced by llvm::MachineInstr::addRegisterDead(), llvm::MachineInstr::addRegisterKilled(), llvm::PhysRegTracker::addRegUse(), llvm::VirtRegMap::assignVirt2Phys(), llvm::ScheduleDAGInstrs::BuildSchedGraph(), llvm::SelectionDAGLowering::CopyValueToVirtualRegister(), llvm::PhysRegTracker::delRegUse(), llvm::MachineInstr::findRegisterDefOperandIdx(), llvm::MachineInstr::findRegisterUseOperandIdx(), getPhysicalRegisterRegClass(), llvm::LiveIntervals::getVNInfoSourceReg(), llvm::PhysRegTracker::isRegAvail(), LowerFORMAL_ARGUMENTS(), OutputReg(), llvm::LiveInterval::print(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86IntelAsmPrinter::printOperand(), llvm::X86ATTAsmPrinter::printOperand(), llvm::X86InstrInfo::reMaterialize(), removeIntervalIfEmpty(), removeRange(), llvm::SimpleRegisterCoalescing::runOnMachineFunction(), and llvm::LiveVariables::runOnMachineFunction().
| static bool llvm::TargetRegisterInfo::isVirtualRegister | ( | unsigned | Reg | ) | [inline, static] |
isVirtualRegister - Return true if the specified register number is in the virtual register namespace.
Definition at line 284 of file TargetRegisterInfo.h.
References FirstVirtualRegister.
Referenced by llvm::VirtRegMap::assignVirt2Phys(), llvm::VirtRegMap::assignVirt2StackSlot(), llvm::VirtRegMap::assignVirtReMatId(), CheckForPhysRegDependency(), llvm::VirtRegMap::clearVirt(), llvm::LiveIntervals::conflictsWithPhysRegDef(), llvm::LiveIntervals::conflictsWithPhysRegRef(), llvm::ARMInstrInfo::convertToThreeAddress(), EmitLiveInCopy(), llvm::ScheduleDAGSDNodes::EmitNode(), llvm::RegsForValue::getCopyFromRegs(), llvm::VirtRegMap::getPhys(), llvm::VirtRegMap::getReMatId(), llvm::VirtRegMap::getStackSlot(), llvm::LiveVariables::getVarInfo(), llvm::MachineOperand::print(), regsOverlap(), llvm::LiveVariables::removeVirtualRegistersKilled(), llvm::SimpleRegisterCoalescing::runOnMachineFunction(), and llvm::LiveVariables::runOnMachineFunction().
| const TargetRegisterClass * TargetRegisterInfo::getPhysicalRegisterRegClass | ( | unsigned | reg, | |
| MVT | VT = MVT::Other | |||
| ) | const |
getPhysicalRegisterRegClass - Returns the Register Class of a physical register of the given type. If type is MVT::Other, then just return any register class the register belongs to.
getPhysicalRegisterRegClass - Returns the Register Class of a physical register of the given type. If type is MVT::Other, then just return any register class the register belongs to.
Definition at line 42 of file TargetRegisterInfo.cpp.
References llvm::TargetRegisterClass::contains(), E, llvm::TargetRegisterClass::hasSuperClass(), llvm::TargetRegisterClass::hasType(), I, isPhysicalRegister(), llvm::MVT::Other, regclass_begin(), and regclass_end().
Referenced by CheckForPhysRegDependency(), and llvm::ScheduleDAGSDNodes::EmitNode().
| BitVector TargetRegisterInfo::getAllocatableSet | ( | MachineFunction & | MF, | |
| const TargetRegisterClass * | RC = NULL | |||
| ) | const |
getAllocatableSet - Returns a bitset indexed by register number indicating if a register is allocatable or not. If a register class is specified, returns the subset for the class.
Definition at line 68 of file TargetRegisterInfo.cpp.
References E, getAllocatableSetForRC(), I, regclass_begin(), and regclass_end().
Referenced by llvm::SimpleRegisterCoalescing::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().
| const TargetRegisterDesc& llvm::TargetRegisterInfo::operator[] | ( | unsigned | RegNo | ) | const [inline] |
| const TargetRegisterDesc& llvm::TargetRegisterInfo::get | ( | unsigned | RegNo | ) | const [inline] |
Provide a get method, equivalent to [], but more useful if we have a pointer to this object.
Definition at line 310 of file TargetRegisterInfo.h.
References operator[]().
Referenced by OutputReg(), llvm::MachineOperand::print(), and llvm::X86IntelAsmPrinter::printOperand().
getAliasSet - Return the set of registers aliased by the specified register, or a null list of there are none. The list returned is zero terminated.
Definition at line 318 of file TargetRegisterInfo.h.
Referenced by llvm::MachineInstr::addRegisterDead(), llvm::MachineInstr::addRegisterKilled(), llvm::PhysRegTracker::addRegUse(), areAliases(), llvm::ScheduleDAGInstrs::BuildSchedGraph(), llvm::PhysRegTracker::delRegUse(), llvm::LiveIntervals::spillPhysRegAroundRegDefsUses(), UpdateKills(), and updateSpillWeights().
getSubRegisters - Return the list of registers that are sub-registers of the specified register, or a null list of there are none. The list returned is zero terminated and sorted according to super-sub register relations. e.g. X86::RAX's sub-register list is EAX, AX, AL, AH.
Definition at line 327 of file TargetRegisterInfo.h.
Referenced by llvm::MachineInstr::addRegisterDead(), removeIntervalIfEmpty(), removeRange(), llvm::RegScavenger::setUnused(), llvm::RegScavenger::setUsed(), and llvm::LiveIntervals::spillPhysRegAroundRegDefsUses().
getSuperRegisters - Return the list of registers that are super-registers of the specified register, or a null list of there are none. The list returned is zero terminated and sorted according to super-sub register relations. e.g. X86::AL's super-register list is RAX, EAX, AX.
Definition at line 336 of file TargetRegisterInfo.h.
Referenced by llvm::MachineInstr::addRegisterDead(), getMatchingSuperReg(), llvm::LiveIntervals::getRepresentativeReg(), and isSuperRegister().
| const char* llvm::TargetRegisterInfo::getAsmName | ( | unsigned | RegNo | ) | const [inline] |
getAsmName - Return the symbolic target-specific name for the specified physical register.
Definition at line 342 of file TargetRegisterInfo.h.
Referenced by llvm::X86ATTAsmPrinter::printAsmMRegister(), llvm::AsmPrinter::printImplicitDef(), and llvm::X86ATTAsmPrinter::printOperand().
| const char* llvm::TargetRegisterInfo::getName | ( | unsigned | RegNo | ) | const [inline] |
getName - Return the human-readable symbolic target-specific name for the specified physical register.
Definition at line 348 of file TargetRegisterInfo.h.
References Name.
Referenced by llvm::VirtRegMap::print(), llvm::MachineFunction::print(), llvm::LiveInterval::print(), llvm::X86IntelAsmPrinter::printAsmMRegister(), and llvm::X86IntelAsmPrinter::printOp().
| unsigned llvm::TargetRegisterInfo::getNumRegs | ( | ) | const [inline] |
getNumRegs - Return the number of registers this target has (useful for sizing arrays holding per register information)
Definition at line 354 of file TargetRegisterInfo.h.
Referenced by llvm::CCState::CCState(), llvm::RegScavenger::enterBasicBlock(), llvm::MachineRegisterInfo::MachineRegisterInfo(), and llvm::LiveVariables::runOnMachineFunction().
areAliases - Returns true if the two registers alias each other, false otherwise
Definition at line 360 of file TargetRegisterInfo.h.
References getAliasSet().
Referenced by regsOverlap().
regsOverlap - Returns true if the two registers are equal or alias each other. The registers may be virtual register.
Definition at line 368 of file TargetRegisterInfo.h.
References areAliases(), and isVirtualRegister().
Referenced by canClobberPhysRegDefs(), llvm::LiveIntervals::conflictsWithPhysRegDef(), and EmitLiveInCopy().
isSubRegister - Returns true if regB is a sub-register of regA.
Definition at line 379 of file TargetRegisterInfo.h.
References index, SubregHash, and SubregHashSize.
Referenced by llvm::MachineInstr::addRegisterDead(), llvm::MachineInstr::addRegisterKilled(), llvm::LiveIntervals::conflictsWithPhysRegRef(), llvm::MachineInstr::findRegisterDefOperandIdx(), and llvm::MachineInstr::findRegisterUseOperandIdx().
isSuperRegister - Returns true if regB is a super-register of regA.
Definition at line 397 of file TargetRegisterInfo.h.
References getSuperRegisters(), and SR.
Referenced by llvm::MachineInstr::addRegisterDead(), llvm::MachineInstr::addRegisterKilled(), RedefinesSuperRegPart(), and llvm::LiveIntervals::spillPhysRegAroundRegDefsUses().
| virtual const unsigned* llvm::TargetRegisterInfo::getCalleeSavedRegs | ( | const MachineFunction * | MF = 0 |
) | const [pure virtual] |
getCalleeSavedRegs - Return a null-terminated list of all of the callee saved registers on this target. The register should be in the order of desired callee-save stack frame offset. The first register is closed to the incoming stack pointer if stack grows down, and vice versa.
Referenced by llvm::RegScavenger::enterBasicBlock().
| virtual const TargetRegisterClass* const* llvm::TargetRegisterInfo::getCalleeSavedRegClasses | ( | const MachineFunction * | MF | ) | const [pure virtual] |
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 getCalleeSaveRegs() list.
| virtual BitVector llvm::TargetRegisterInfo::getReservedRegs | ( | const MachineFunction & | MF | ) | const [pure virtual] |
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.
Referenced by llvm::RegScavenger::enterBasicBlock(), and llvm::LiveVariables::runOnMachineFunction().
| virtual unsigned llvm::TargetRegisterInfo::getSubReg | ( | unsigned | RegNo, | |
| unsigned | Index | |||
| ) | const [pure virtual] |
getSubReg - Returns the physical register number of sub-register "Index" for physical register RegNo. Return zero if the sub-register does not exist.
Referenced by findSuperReg(), getMatchingSuperReg(), llvm::LiveIntervals::getVNInfoSourceReg(), and ReMaterialize().
| regclass_iterator llvm::TargetRegisterInfo::regclass_begin | ( | ) | const [inline] |
Register class iterators
Definition at line 433 of file TargetRegisterInfo.h.
Referenced by getAllocatableSet(), getNumRegClasses(), getPhysicalRegisterRegClass(), isAllocatableRegister(), and llvm::SimpleRegisterCoalescing::runOnMachineFunction().
| regclass_iterator llvm::TargetRegisterInfo::regclass_end | ( | ) | const [inline] |
Definition at line 434 of file TargetRegisterInfo.h.
Referenced by getAllocatableSet(), getNumRegClasses(), getPhysicalRegisterRegClass(), isAllocatableRegister(), and llvm::SimpleRegisterCoalescing::runOnMachineFunction().
| unsigned llvm::TargetRegisterInfo::getNumRegClasses | ( | ) | const [inline] |
Definition at line 436 of file TargetRegisterInfo.h.
References regclass_begin(), and regclass_end().
Referenced by getRegClass(), and llvm::MachineRegisterInfo::MachineRegisterInfo().
| const TargetRegisterClass* llvm::TargetRegisterInfo::getRegClass | ( | unsigned | i | ) | const [inline] |
getRegClass - Returns the register class associated with the enumeration value. See class TargetOperandInfo.
Definition at line 442 of file TargetRegisterInfo.h.
References getNumRegClasses().
Referenced by getInstrOperandRegClass().
| virtual const TargetRegisterClass* llvm::TargetRegisterInfo::getCrossCopyRegClass | ( | const TargetRegisterClass * | RC | ) | const [inline, virtual] |
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 457 of file TargetRegisterInfo.h.
| virtual bool llvm::TargetRegisterInfo::targetHandlesStackFrameRounding | ( | ) | const [inline, virtual] |
targetHandlesStackFrameRounding - Returns true if the target is responsible for rounding up the stack frame (probably at emitPrologue time).
Definition at line 464 of file TargetRegisterInfo.h.
| virtual bool llvm::TargetRegisterInfo::requiresRegisterScavenging | ( | const MachineFunction & | MF | ) | const [inline, virtual] |
requiresRegisterScavenging - returns true if the target requires (and can make use of) the register scavenger.
Definition at line 470 of file TargetRegisterInfo.h.
| virtual bool llvm::TargetRegisterInfo::hasFP | ( | const MachineFunction & | MF | ) | const [pure virtual] |
hasFP - Return true if the specified function should have a dedicated frame pointer register. For most targets this is true only if the function has variable sized allocas or if frame pointer elimination is disabled.
Referenced by hasReservedCallFrame().
| virtual bool llvm::TargetRegisterInfo::hasReservedCallFrame | ( | MachineFunction & | MF | ) | const [inline, virtual] |
| virtual bool llvm::TargetRegisterInfo::needsStackRealignment | ( | const MachineFunction & | MF | ) | const [inline, virtual] |
Definition at line 491 of file TargetRegisterInfo.h.
| int llvm::TargetRegisterInfo::getCallFrameSetupOpcode | ( | ) | const [inline] |
getCallFrameSetup/DestroyOpcode - These methods return the opcode of the frame setup/destroy instructions if they exist (-1 otherwise). Some targets use pseudo instructions in order to abstract away the difference between operating with a frame pointer and operating without, through the use of these two instructions.
Definition at line 501 of file TargetRegisterInfo.h.
Referenced by eliminateCallFramePseudoInstr().
| int llvm::TargetRegisterInfo::getCallFrameDestroyOpcode | ( | ) | const [inline] |
| virtual void llvm::TargetRegisterInfo::eliminateCallFramePseudoInstr | ( | MachineFunction & | MF, | |
| MachineBasicBlock & | MBB, | |||
| MachineBasicBlock::iterator | MI | |||
| ) | const [inline, virtual] |
eliminateCallFramePseudoInstr - This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy pseudo instructions (but only if the Target is using them). It is responsible for eliminating these instructions, replacing them with concrete instructions. This method need only be implemented if using call frame setup/destroy pseudo instructions.
Definition at line 513 of file TargetRegisterInfo.h.
References getCallFrameDestroyOpcode(), and getCallFrameSetupOpcode().
| virtual void llvm::TargetRegisterInfo::processFunctionBeforeCalleeSavedScan | ( | MachineFunction & | MF, | |
| RegScavenger * | RS = NULL | |||
| ) | const [inline, virtual] |
processFunctionBeforeCalleeSavedScan - This method is called immediately before PrologEpilogInserter scans the physical registers used to determine what callee saved registers should be spilled. This method is optional.
Definition at line 525 of file TargetRegisterInfo.h.
| virtual void llvm::TargetRegisterInfo::processFunctionBeforeFrameFinalized | ( | MachineFunction & | MF | ) | const [inline, virtual] |
processFunctionBeforeFrameFinalized - This method is called immediately before the specified functions frame layout (MF.getFrameInfo()) is finalized. Once the frame is finalized, MO_FrameIndex operands are replaced with direct constants. This method is optional.
Definition at line 535 of file TargetRegisterInfo.h.
| virtual void llvm::TargetRegisterInfo::eliminateFrameIndex | ( | MachineBasicBlock::iterator | MI, | |
| int | SPAdj, | |||
| RegScavenger * | RS = NULL | |||
| ) | const [pure virtual] |
eliminateFrameIndex - This method must be overriden to eliminate abstract frame indices from instructions which may use them. The instruction referenced by the iterator contains an MO_FrameIndex operand which must be eliminated by this method. This method may modify or replace the specified instruction, as long as it keeps the iterator pointing the the finished product. SPAdj is the SP adjustment due to call frame setup instruction.
| virtual void llvm::TargetRegisterInfo::emitPrologue | ( | MachineFunction & | MF | ) | const [pure virtual] |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
| virtual void llvm::TargetRegisterInfo::emitEpilogue | ( | MachineFunction & | MF, | |
| MachineBasicBlock & | MBB | |||
| ) | const [pure virtual] |
| virtual int llvm::TargetRegisterInfo::getDwarfRegNum | ( | unsigned | RegNum, | |
| bool | isEH | |||
| ) | const [pure virtual] |
Debug information queries.
getDwarfRegNum - Map a target register to an equivalent dwarf register number. Returns -1 if there is no equivalent value. The second parameter allows targets to use different numberings for EH info and debugging info.
| virtual unsigned llvm::TargetRegisterInfo::getFrameRegister | ( | MachineFunction & | MF | ) | const [pure virtual] |
getFrameRegister - This method should return the register used as a base for values allocated in the current stack frame.
| int TargetRegisterInfo::getFrameIndexOffset | ( | MachineFunction & | MF, | |
| int | FI | |||
| ) | const [virtual] |
getFrameIndexOffset - Returns the displacement from the frame register to the stack frame of the specified index.
getFrameIndexOffset - Returns the displacement from the frame register to the stack frame of the specified index. This is the default implementation which is likely incorrect for the target.
Definition at line 85 of file TargetRegisterInfo.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::TargetMachine::getFrameInfo(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineFrameInfo::getOffsetAdjustment(), llvm::TargetFrameInfo::getOffsetOfLocalArea(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getTarget(), and MFI.
| virtual unsigned llvm::TargetRegisterInfo::getRARegister | ( | ) | const [pure virtual] |
getRARegister - This method should return the register where the return address can be found.
| void TargetRegisterInfo::getInitialFrameState | ( | std::vector< MachineMove > & | Moves | ) | const [virtual] |
getInitialFrameState - Returns a list of machine moves that are assumed on entry to all functions. Note that LabelID is ignored (assumed to be the beginning of the function.)
getInitialFrameState - Returns a list of machine moves that are assumed on entry to a function.
Definition at line 95 of file TargetRegisterInfo.cpp.
const unsigned* llvm::TargetRegisterInfo::SubregHash [protected] |
const unsigned llvm::TargetRegisterInfo::SubregHashSize [protected] |
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.