LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
llvm::PBQPRAProblem Class Reference

#include <RegAllocPBQP.h>

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::NodeId nodeId, AllowedRegsItr arBegin, AllowedRegsItr arEnd)
 
unsigned getVRegForNode (PBQP::Graph::NodeId nodeId) const
 Get the virtual register corresponding to the given PBQP node. More...
 
PBQP::Graph::NodeId getNodeForVReg (unsigned vreg) const
 Get the PBQP node corresponding to the given virtual register. More...
 
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. More...
 
unsigned getPRegForOption (unsigned vreg, unsigned option) const
 Get PReg for option. More...
 

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
PBQP::Graph& llvm::PBQPRAProblem::getGraph ( )
inline
const PBQP::Graph& llvm::PBQPRAProblem::getGraph ( ) const
inline

Definition at line 46 of file RegAllocPBQP.h.

PBQP::Graph::NodeId PBQPRAProblem::getNodeForVReg ( unsigned  vreg) const
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::NodeId  nodeId) 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::NodeId  nodeId,
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().

Referenced by llvm::PBQPBuilder::build().


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