|
LLVM
5.0.0
|
#include "llvm/Target/TargetRegisterInfo.h"
Public Types | |
| using | iterator = const MCPhysReg * |
| using | const_iterator = const MCPhysReg * |
| using | sc_iterator = const TargetRegisterClass *const * |
Public Member Functions | |
| unsigned | getID () const |
| Return the register class ID number. More... | |
| iterator | begin () const |
| begin/end - Return all of the registers in this class. More... | |
| iterator | end () const |
| unsigned | getNumRegs () const |
| Return the number of registers in this class. More... | |
| iterator_range < SmallVectorImpl< MCPhysReg > ::const_iterator > | getRegisters () const |
| unsigned | getRegister (unsigned i) const |
| Return the specified register in the class. More... | |
| bool | contains (unsigned Reg) const |
| Return true if the specified register is included in this register class. More... | |
| bool | contains (unsigned Reg1, unsigned Reg2) const |
| Return true if both registers are in this class. More... | |
| int | getCopyCost () const |
| Return the cost of copying a value between two registers in this class. More... | |
| bool | isAllocatable () const |
| Return true if this register class may be used to create virtual registers. More... | |
| bool | hasSubClass (const TargetRegisterClass *RC) const |
| Return true if the specified TargetRegisterClass is a proper sub-class of this TargetRegisterClass. More... | |
| bool | hasSubClassEq (const TargetRegisterClass *RC) const |
| Returns true if RC is a sub-class of or equal to this class. More... | |
| bool | hasSuperClass (const TargetRegisterClass *RC) const |
| Return true if the specified TargetRegisterClass is a proper super-class of this TargetRegisterClass. More... | |
| bool | hasSuperClassEq (const TargetRegisterClass *RC) const |
| Returns true if RC is a super-class of or equal to this class. More... | |
| const uint32_t * | getSubClassMask () const |
| Returns a bit vector of subclasses, including this one. More... | |
| const uint16_t * | getSuperRegIndices () const |
| Returns a 0-terminated list of sub-register indices that project some super-register class into this register class. More... | |
| sc_iterator | getSuperClasses () const |
| Returns a NULL-terminated list of super-classes. More... | |
| bool | isASubClass () const |
| Return true if this TargetRegisterClass is a subset class of at least one other TargetRegisterClass. More... | |
| ArrayRef< MCPhysReg > | getRawAllocationOrder (const MachineFunction &MF) const |
| Returns the preferred order for allocating registers from this register class in MF. More... | |
| LaneBitmask | getLaneMask () const |
| Returns the combination of all lane masks of register in this class. More... | |
Public Attributes | |
| const MCRegisterClass * | MC |
| const uint16_t | SpillSize |
| const uint16_t | SpillAlignment |
| const MVT::SimpleValueType * | VTs |
| const uint32_t * | SubClassMask |
| const uint16_t * | SuperRegIndices |
| const LaneBitmask | LaneMask |
| const uint8_t | AllocationPriority |
| Classes with a higher priority value are assigned first by register allocators using a greedy heuristic. More... | |
| const bool | HasDisjunctSubRegs |
| Whether the class supports two (or more) disjunct subregister indices. More... | |
| const bool | CoveredBySubRegs |
| Whether a combination of subregisters can cover every register in the class. More... | |
| const sc_iterator | SuperClasses |
| ArrayRef< MCPhysReg >(* | OrderFunc )(const MachineFunction &) |
Definition at line 44 of file TargetRegisterInfo.h.
Definition at line 47 of file TargetRegisterInfo.h.
Definition at line 46 of file TargetRegisterInfo.h.
Definition at line 48 of file TargetRegisterInfo.h.
|
inline |
begin/end - Return all of the registers in this class.
Definition at line 73 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::begin(), and MC.
Referenced by allocateCCRegs(), llvm::PPCInstrInfo::DefinesPredicate(), getRawAllocationOrder(), llvm::BitTracker::MachineEvaluator::getRegBitWidth(), and GetRegistersForValue().
Return true if the specified register is included in this register class.
This does not include virtual registers.
Definition at line 91 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::contains(), and MC.
Referenced by llvm::MachineFunction::addLiveIn(), canFoldCopy(), llvm::SystemZInstrInfo::convertToThreeAddress(), copyHint(), llvm::PPCInstrInfo::DefinesPredicate(), llvm::R600InstrInfo::getIndirectIndexBegin(), llvm::PPCInstrInfo::insertSelect(), llvm::CoalescerPair::setRegisters(), UpdateOperandRegClass(), and llvm::SIInstrInfo::verifyInstruction().
Return true if both registers are in this class.
Definition at line 96 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::contains(), and MC.
|
inline |
Definition at line 74 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::end(), and MC.
Referenced by llvm::PPCInstrInfo::DefinesPredicate(), llvm::BitTracker::MachineEvaluator::getRegBitWidth(), and GetRegistersForValue().
|
inline |
Return the cost of copying a value between two registers in this class.
A negative number means the register class is very expensive to copy e.g. status flag register classes.
Definition at line 103 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::getCopyCost(), and MC.
Referenced by CheckForPhysRegDependency().
|
inline |
Return the register class ID number.
Definition at line 69 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::getID(), and MC.
Referenced by llvm::RegsForValue::AddInlineAsmOperands(), llvm::SIInstrInfo::canInsertSelect(), llvm::RegisterBank::covers(), llvm::HexagonRegisterInfo::getCallerSavedRegs(), GetCostForDef(), llvm::HexagonRegisterInfo::getHexagonSubRegIndex(), llvm::ARMBaseRegisterInfo::getLargestLegalSuperClass(), llvm::ARMRegisterBankInfo::getRegBankFromRegClass(), llvm::AArch64RegisterBankInfo::getRegBankFromRegClass(), llvm::MipsRegisterInfo::getRegPressureLimit(), llvm::PPCRegisterInfo::getRegPressureLimit(), llvm::X86RegisterInfo::getRegPressureLimit(), llvm::AArch64RegisterInfo::getRegPressureLimit(), llvm::ARMBaseRegisterInfo::getRegPressureLimit(), llvm::SIRegisterInfo::getRegPressureLimit(), hasSubClassEq(), INITIALIZE_PASS(), llvm::ResourcePriorityQueue::rawRegPressureDelta(), and llvm::ResourcePriorityQueue::scheduledNode().
|
inline |
Returns the combination of all lane masks of register in this class.
The lane masks of the registers are the combination of all lane masks of their subregisters. Returns 1 if there are no subregisters.
Definition at line 196 of file TargetRegisterInfo.h.
References LaneMask.
Referenced by llvm::ScheduleDAGInstrs::getLaneMaskForMO(), and llvm::MachineRegisterInfo::getMaxLaneMaskForVReg().
|
inline |
Return the number of registers in this class.
Definition at line 77 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::getNumRegs(), and MC.
Referenced by llvm::RegisterClassInfo::computePSetLimit(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::R600InstrInfo::getIndirectIndexBegin(), getRawAllocationOrder(), and llvm::ExecutionDepsFix::runOnMachineFunction().
|
inline |
Returns the preferred order for allocating registers from this register class in MF.
The raw order comes directly from the .td file and may include reserved registers that are not allocatable. Register allocators should also make sure to allocate callee-saved registers only after all the volatiles are used. The RegisterClassInfo class provides filtered allocation orders with callee-saved registers moved to the end.
The MachineFunction argument can be used to tune the allocatable registers based on the characteristics of the function, subtarget, or other criteria.
By default, this method returns all registers in the class.
Definition at line 189 of file TargetRegisterInfo.h.
References begin(), getNumRegs(), llvm::makeArrayRef(), and OrderFunc.
Referenced by getAllocatableSetForRC(), and llvm::RegScavenger::scavengeRegisterBackwards().
Return the specified register in the class.
Definition at line 85 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::getRegister(), and MC.
Referenced by llvm::R600InstrInfo::expandPostRAPseudo(), llvm::R600InstrInfo::getIndirectIndexBegin(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), and llvm::tryFoldSPUpdateIntoPushPop().
|
inline |
Definition at line 80 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::begin(), llvm::MCRegisterClass::end(), llvm::make_range(), and MC.
Returns a bit vector of subclasses, including this one.
The vector is indexed by class IDs.
To use it, consider the returned array as a chunk of memory that contains an array of bits of size NumRegClasses. Each 32-bit chunk contains a bitset of the ID of the subclasses in big-endian style. I.e., the representation of the memory from left to right at the bit level looks like: [31 30 ... 1 0] [ 63 62 ... 33 32] ... [ XXX NumRegClasses NumRegClasses - 1 ... ] Where the number represents the class ID and XXX bits that should be ignored.
See the implementation of hasSubClassEq for an example of how it can be used.
Definition at line 148 of file TargetRegisterInfo.h.
References SubClassMask.
Referenced by llvm::TargetRegisterInfo::getAllocatableClass(), llvm::TargetRegisterInfo::getCommonSubClass(), and llvm::TargetRegisterInfo::getMatchingSuperRegClass().
|
inline |
Returns a NULL-terminated list of super-classes.
The classes are ordered by ID which is also a topological ordering from large to small classes. The list does NOT include the current class.
Definition at line 166 of file TargetRegisterInfo.h.
References SuperClasses.
Referenced by llvm::HexagonRegisterInfo::getHexagonSubRegIndex(), llvm::X86RegisterInfo::getLargestLegalSuperClass(), and llvm::ARMBaseRegisterInfo::getLargestLegalSuperClass().
|
inline |
Returns a 0-terminated list of sub-register indices that project some super-register class into this register class.
The list has an entry for each Idx such that:
There exists SuperRC where: For all Reg in SuperRC: this->contains(Reg:Idx)
Definition at line 159 of file TargetRegisterInfo.h.
References SuperRegIndices.
|
inline |
Return true if the specified TargetRegisterClass is a proper sub-class of this TargetRegisterClass.
Definition at line 111 of file TargetRegisterInfo.h.
References hasSubClassEq().
Referenced by llvm::TargetRegisterInfo::getMinimalPhysRegClass(), and hasSuperClass().
|
inline |
Returns true if RC is a sub-class of or equal to this class.
Definition at line 116 of file TargetRegisterInfo.h.
References getID(), and SubClassMask.
Referenced by llvm::MachineFunction::addLiveIn(), canFoldCopy(), hasSubClass(), hasSuperClassEq(), UpdateOperandRegClass(), and llvm::RegisterBank::verify().
|
inline |
Return true if the specified TargetRegisterClass is a proper super-class of this TargetRegisterClass.
Definition at line 123 of file TargetRegisterInfo.h.
References hasSubClass().
|
inline |
Returns true if RC is a super-class of or equal to this class.
Definition at line 128 of file TargetRegisterInfo.h.
References hasSubClassEq().
Referenced by llvm::PPCInstrInfo::getOperandLatency(), isFPR64(), isFRClass(), and isGRClass().
|
inline |
Return true if this register class may be used to create virtual registers.
Definition at line 107 of file TargetRegisterInfo.h.
References llvm::MCRegisterClass::isAllocatable(), and MC.
Referenced by llvm::MachineRegisterInfo::createVirtualRegister(), llvm::TargetRegisterInfo::getAllocatableClass(), getAllocatableSetForRC(), and llvm::MachineRegisterInfo::setRegClass().
|
inline |
Return true if this TargetRegisterClass is a subset class of at least one other TargetRegisterClass.
Definition at line 172 of file TargetRegisterInfo.h.
References SuperClasses.
| const uint8_t llvm::TargetRegisterClass::AllocationPriority |
Classes with a higher priority value are assigned first by register allocators using a greedy heuristic.
The value is in the range [0,63].
Definition at line 59 of file TargetRegisterInfo.h.
Whether a combination of subregisters can cover every register in the class.
See also the CoveredBySubRegs description in Target.td.
Definition at line 64 of file TargetRegisterInfo.h.
Whether the class supports two (or more) disjunct subregister indices.
Definition at line 61 of file TargetRegisterInfo.h.
Referenced by llvm::ScheduleDAGInstrs::getLaneMaskForMO(), and llvm::MachineRegisterInfo::shouldTrackSubRegLiveness().
| const LaneBitmask llvm::TargetRegisterClass::LaneMask |
Definition at line 56 of file TargetRegisterInfo.h.
Referenced by getLaneMask(), and llvm::rdf::CopyPropagation::run().
| const MCRegisterClass* llvm::TargetRegisterClass::MC |
Definition at line 51 of file TargetRegisterInfo.h.
Referenced by begin(), contains(), end(), getCopyCost(), getID(), llvm::TargetRegisterInfo::getMatchingSuperReg(), getNumRegs(), llvm::TargetRegisterInfo::getRegClassName(), getRegister(), getRegisters(), llvm::SIRegisterInfo::getRegSplitParts(), and isAllocatable().
| ArrayRef<MCPhysReg>(* llvm::TargetRegisterClass::OrderFunc)(const MachineFunction &) |
Definition at line 66 of file TargetRegisterInfo.h.
Referenced by getRawAllocationOrder().
| const uint16_t llvm::TargetRegisterClass::SpillAlignment |
Definition at line 52 of file TargetRegisterInfo.h.
Referenced by llvm::TargetRegisterInfo::getSpillAlignment().
| const uint16_t llvm::TargetRegisterClass::SpillSize |
Definition at line 52 of file TargetRegisterInfo.h.
Referenced by llvm::TargetRegisterInfo::getRegSizeInBits(), and llvm::TargetRegisterInfo::getSpillSize().
Definition at line 54 of file TargetRegisterInfo.h.
Referenced by getSubClassMask(), and hasSubClassEq().
| const sc_iterator llvm::TargetRegisterClass::SuperClasses |
Definition at line 65 of file TargetRegisterInfo.h.
Referenced by getSuperClasses(), and isASubClass().
| const uint16_t* llvm::TargetRegisterClass::SuperRegIndices |
Definition at line 55 of file TargetRegisterInfo.h.
Referenced by getSuperRegIndices().
| const MVT::SimpleValueType* llvm::TargetRegisterClass::VTs |
Definition at line 53 of file TargetRegisterInfo.h.
Referenced by llvm::TargetRegisterInfo::isTypeLegalForClass(), llvm::TargetRegisterInfo::legalclasstypes_begin(), and llvm::TargetRegisterInfo::legalclasstypes_end().
1.8.6