LLVM API Documentation
#include <AllocationOrder.h>
Public Member Functions | |
AllocationOrder (unsigned VirtReg, const VirtRegMap &VRM, const RegisterClassInfo &RegClassInfo) | |
ArrayRef< MCPhysReg > | getOrder () const |
Get the allocation order without reordered hints. | |
unsigned | next (unsigned Limit=0) |
unsigned | nextWithDups (unsigned Limit) |
void | rewind () |
Start over from the beginning. | |
bool | isHint () const |
Return true if the last register returned from next() was a preferred register. | |
bool | isHint (unsigned PhysReg) const |
Return true if PhysReg is a preferred register. |
Definition at line 28 of file AllocationOrder.h.
AllocationOrder::AllocationOrder | ( | unsigned | VirtReg, |
const VirtRegMap & | VRM, | ||
const RegisterClassInfo & | RegClassInfo | ||
) |
Create a new AllocationOrder for VirtReg.
VirtReg | Virtual register to allocate for. |
VRM | Virtual register map for function. |
RegClassInfo | Information about reserved and allocatable registers. |
Definition at line 30 of file AllocationOrder.cpp.
References llvm::ArrayRef< T >::begin(), llvm::dbgs(), DEBUG, llvm::SmallVectorBase::empty(), llvm::ArrayRef< T >::end(), llvm::VirtRegMap::getMachineFunction(), llvm::RegisterClassInfo::getOrder(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::VirtRegMap::getTargetRegInfo(), I, rewind(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
ArrayRef<MCPhysReg> llvm::AllocationOrder::getOrder | ( | ) | const [inline] |
Get the allocation order without reordered hints.
Definition at line 43 of file AllocationOrder.h.
bool llvm::AllocationOrder::isHint | ( | ) | const [inline] |
Return true if the last register returned from next() was a preferred register.
Definition at line 77 of file AllocationOrder.h.
Referenced by next().
bool llvm::AllocationOrder::isHint | ( | unsigned | PhysReg | ) | const [inline] |
Return true if PhysReg is a preferred register.
Definition at line 80 of file AllocationOrder.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and llvm::SmallVectorTemplateCommon< T, typename >::end().
unsigned llvm::AllocationOrder::next | ( | unsigned | Limit = 0 | ) | [inline] |
Return the next physical register in the allocation order, or 0. It is safe to call next() again after it returned 0, it will keep returning 0 until rewind() is called.
Definition at line 48 of file AllocationOrder.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end(), isHint(), and llvm::ArrayRef< T >::size().
unsigned llvm::AllocationOrder::nextWithDups | ( | unsigned | Limit | ) | [inline] |
As next(), but allow duplicates to be returned, and stop before the Limit'th register in the RegisterClassInfo allocation order.
This can produce more than Limit registers if there are hints.
Definition at line 65 of file AllocationOrder.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
void llvm::AllocationOrder::rewind | ( | ) | [inline] |
Start over from the beginning.
Definition at line 74 of file AllocationOrder.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by AllocationOrder().