LLVM  6.0.0svn
Public Member Functions | List of all members
llvm::AllocationOrder Class Reference

#include "CodeGen/AllocationOrder.h"

Public Member Functions

 AllocationOrder (unsigned VirtReg, const VirtRegMap &VRM, const RegisterClassInfo &RegClassInfo, const LiveRegMatrix *Matrix)
 Create a new AllocationOrder for VirtReg. More...
 
ArrayRef< MCPhysReggetOrder () const
 Get the allocation order without reordered hints. More...
 
unsigned next (unsigned Limit=0)
 Return the next physical register in the allocation order, or 0. More...
 
unsigned nextWithDups (unsigned Limit)
 As next(), but allow duplicates to be returned, and stop before the Limit'th register in the RegisterClassInfo allocation order. More...
 
void rewind ()
 Start over from the beginning. More...
 
bool isHint () const
 Return true if the last register returned from next() was a preferred register. More...
 
bool isHint (unsigned PhysReg) const
 Return true if PhysReg is a preferred register. More...
 

Detailed Description

Definition at line 30 of file AllocationOrder.h.

Constructor & Destructor Documentation

◆ AllocationOrder()

AllocationOrder::AllocationOrder ( unsigned  VirtReg,
const VirtRegMap VRM,
const RegisterClassInfo RegClassInfo,
const LiveRegMatrix Matrix 
)

Member Function Documentation

◆ getOrder()

ArrayRef<MCPhysReg> llvm::AllocationOrder::getOrder ( ) const
inline

Get the allocation order without reordered hints.

Definition at line 46 of file AllocationOrder.h.

Referenced by llvm::createGreedyRegisterAllocator().

◆ isHint() [1/2]

bool llvm::AllocationOrder::isHint ( ) const
inline

Return true if the last register returned from next() was a preferred register.

Definition at line 80 of file AllocationOrder.h.

Referenced by llvm::createGreedyRegisterAllocator().

◆ isHint() [2/2]

bool llvm::AllocationOrder::isHint ( unsigned  PhysReg) const
inline

Return true if PhysReg is a preferred register.

Definition at line 83 of file AllocationOrder.h.

References llvm::is_contained().

◆ next()

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 51 of file AllocationOrder.h.

References llvm::ArrayRef< T >::size().

Referenced by llvm::createGreedyRegisterAllocator(), getNumAllocatableRegsForConstraints(), and hasTiedDef().

◆ nextWithDups()

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 68 of file AllocationOrder.h.

◆ rewind()

void llvm::AllocationOrder::rewind ( )
inline

Start over from the beginning.

Definition at line 77 of file AllocationOrder.h.

Referenced by AllocationOrder(), llvm::createGreedyRegisterAllocator(), getNumAllocatableRegsForConstraints(), and hasTiedDef().


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