LLVM API Documentation

Public Types | Public Member Functions
llvm::PBQPRAProblem Class Reference

#include <RegAllocPBQP.h>

List of all members.

Public Types

typedef SmallVector< unsigned, 16 > AllowedSet

Public Member Functions

PBQP::GraphgetGraph ()
const PBQP::GraphgetGraph () const
template<typename AllowedRegsItr >
void recordVReg (unsigned vreg, PBQP::Graph::NodeItr node, AllowedRegsItr arBegin, AllowedRegsItr arEnd)
unsigned getVRegForNode (PBQP::Graph::ConstNodeItr node) const
 Get the virtual register corresponding to the given PBQP node.
PBQP::Graph::NodeItr getNodeForVReg (unsigned vreg) const
 Get the PBQP node corresponding to the given virtual register.
bool isPRegOption (unsigned vreg, unsigned option) const
bool isSpillOption (unsigned vreg, unsigned option) const
const AllowedSetgetAllowedSet (unsigned vreg) const
 Returns the allowed set for the given virtual register.
unsigned getPRegForOption (unsigned vreg, unsigned option) const
 Get PReg for option.

Detailed Description

This class wraps up a PBQP instance representing a register allocation problem, plus the structures necessary to map back from the PBQP solution to a register allocation solution. (i.e. The PBQP-node <--> vreg map, and the PBQP option <--> storage location map).

Definition at line 39 of file RegAllocPBQP.h.


Member Typedef Documentation

Definition at line 42 of file RegAllocPBQP.h.


Member Function Documentation

const PBQPRAProblem::AllowedSet & PBQPRAProblem::getAllowedSet ( unsigned  vreg) const

Returns the allowed set for the given virtual register.

Definition at line 174 of file RegAllocPBQP.cpp.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find().

Referenced by getPRegForOption().

PBQP::Graph& llvm::PBQPRAProblem::getGraph ( ) [inline]

Definition at line 44 of file RegAllocPBQP.h.

const PBQP::Graph& llvm::PBQPRAProblem::getGraph ( ) const [inline]

Definition at line 46 of file RegAllocPBQP.h.

PBQP::Graph::NodeItr PBQPRAProblem::getNodeForVReg ( unsigned  vreg) const

Get the PBQP node corresponding to the given virtual register.

Definition at line 166 of file RegAllocPBQP.cpp.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find().

unsigned PBQPRAProblem::getPRegForOption ( unsigned  vreg,
unsigned  option 
) const

Get PReg for option.

Definition at line 181 of file RegAllocPBQP.cpp.

References getAllowedSet(), isPRegOption(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

unsigned PBQPRAProblem::getVRegForNode ( PBQP::Graph::ConstNodeItr  node) const

Get the virtual register corresponding to the given PBQP node.

Definition at line 160 of file RegAllocPBQP.cpp.

bool llvm::PBQPRAProblem::isPRegOption ( unsigned  vreg,
unsigned  option 
) const [inline]

Returns true if the given PBQP option represents a physical register, false otherwise.

Definition at line 74 of file RegAllocPBQP.h.

References isSpillOption().

Referenced by getPRegForOption().

bool llvm::PBQPRAProblem::isSpillOption ( unsigned  vreg,
unsigned  option 
) const [inline]

Returns true if the given PBQP option represents spilling, false otherwise.

Definition at line 82 of file RegAllocPBQP.h.

Referenced by isPRegOption().

template<typename AllowedRegsItr >
void llvm::PBQPRAProblem::recordVReg ( unsigned  vreg,
PBQP::Graph::NodeItr  node,
AllowedRegsItr  arBegin,
AllowedRegsItr  arEnd 
) [inline]

Record the mapping between the given virtual register and PBQP node, and the set of allowed pregs for the vreg.

If you are extending PBQPBuilder you are unlikely to need this: Nodes and options for all vregs will already have been set up for you by the base class.

Definition at line 55 of file RegAllocPBQP.h.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find().


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