CACAO
Data Structures | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
cacao::jit::compiler2::LinearScanAllocatorPass Class Reference

Linear Scan Allocator. More...

Inheritance diagram for cacao::jit::compiler2::LinearScanAllocatorPass:
cacao::jit::compiler2::Pass cacao::jit::compiler2::memory::ManagerMixin< LinearScanAllocatorPass >

Data Structures

struct  StartComparator
 

Public Types

typedef alloc::list
< MachineInstruction * >::type 
MoveListTy
 
typedef alloc::priority_queue
< LivetimeInterval,
alloc::deque< LivetimeInterval >
::type, StartComparator >
::type 
UnhandledSetTy
 
typedef alloc::list
< LivetimeInterval >::type 
InactiveSetTy
 
typedef alloc::list
< LivetimeInterval >::type 
ActiveSetTy
 
typedef alloc::list
< LivetimeInterval >::type 
HandledSetTy
 

Public Member Functions

 LinearScanAllocatorPass ()
 
virtual void initialize ()
 Initialize the Pass. More...
 
virtual bool run (JITData &JD)
 Run the Pass. More...
 
virtual PassUsageget_PassUsage (PassUsage &PA) const
 Set the requirements for the pass. More...
 
virtual bool verify () const
 Verify the Result. More...
 
- Public Member Functions inherited from cacao::jit::compiler2::Pass
 Pass ()
 
void set_PassManager (PassManager *PM)
 
template<class _PassClass >
_PassClass * get_Pass () const
 Get the result of a previous compiler pass. More...
 
template<class _PassClass >
_PassClass * get_Pass_if_available () const
 Get the result of a previous compiler pass. More...
 
virtual void finalize ()
 Finalize the Pass. More...
 
virtual ~Pass ()
 Destructor. More...
 

Static Public Attributes

static char ID = 0
 

Private Member Functions

bool try_allocate_free (LivetimeInterval &current, UseDef pos)
 
bool allocate_blocked (LivetimeInterval &current)
 
bool allocate_unhandled ()
 
bool resolve ()
 
bool reg_alloc_resolve_block (MIIterator first, MIIterator last)
 
bool order_and_insert_move (EdgeMoveMapTy::value_type &entry, BBtoLTI_Map &bb2lti_map)
 

Private Attributes

UnhandledSetTy unhandled
 
ActiveSetTy active
 
InactiveSetTy inactive
 
HandledSetTy handled
 
LivetimeAnalysisPassLA
 
MachineInstructionScheduleMIS
 
Backendbackend
 
JITDatajd
 

Additional Inherited Members

- Static Public Member Functions inherited from cacao::jit::compiler2::memory::ManagerMixin< LinearScanAllocatorPass >
static voidoperator new (std::size_t size) throw (std::bad_alloc)
 normal new More...
 
static voidoperator new (std::size_t size, void *ptr) throw ()
 placement new More...
 
static voidoperator new (std::size_t size, const std::nothrow_t &nt) throw ()
 nothrow new More...
 
static void operator delete (void *pMemory) throw ()
 normal delete More...
 
static void operator delete (void *pMemory, void *ptr) throw ()
 placement delete More...
 
static void operator delete (void *pMemory, const std::nothrow_t &) throw ()
 nothrow delete More...
 
static voidoperator new[] (std::size_t size) throw (std::bad_alloc)
 normal new[] More...
 
static voidoperator new[] (std::size_t size, void *ptr) throw ()
 placement new[] More...
 
static voidoperator new[] (std::size_t size, const std::nothrow_t &nt) throw ()
 nothrow new[] More...
 
static void operator delete[] (void *pMemory) throw ()
 normal delete[] More...
 
static void operator delete[] (void *pMemory, void *ptr) throw ()
 placement delete[] More...
 
static void operator delete[] (void *pMemory, const std::nothrow_t &) throw ()
 nothrow delete[] More...
 

Detailed Description

Linear Scan Allocator.

It supports interval splitting, register hints and fixed intervals and makes use of livetime holes.

Based on the approach from "Optimized Interval Splitting in a Linear Scan Register Allocator" by Wimmer and Moessenboeck [12] with the adoptions from "Linear scan register allocation on SSA form" by Wimmer and Franz [11]. See also Wimmer's Masters Thesis [13].

Definition at line 83 of file LinearScanAllocatorPass.hpp.

Member Typedef Documentation

Definition at line 93 of file LinearScanAllocatorPass.hpp.

Definition at line 94 of file LinearScanAllocatorPass.hpp.

Definition at line 92 of file LinearScanAllocatorPass.hpp.

Definition at line 89 of file LinearScanAllocatorPass.hpp.

Definition at line 91 of file LinearScanAllocatorPass.hpp.

Constructor & Destructor Documentation

cacao::jit::compiler2::LinearScanAllocatorPass::LinearScanAllocatorPass ( )
inline

Definition at line 117 of file LinearScanAllocatorPass.hpp.

Member Function Documentation

bool LinearScanAllocatorPass::allocate_blocked ( LivetimeInterval current)
inlineprivate

Definition at line 481 of file LinearScanAllocatorPass.cpp.

bool LinearScanAllocatorPass::allocate_unhandled ( )
private

Definition at line 548 of file LinearScanAllocatorPass.cpp.

PassUsage & LinearScanAllocatorPass::get_PassUsage ( PassUsage PU) const
virtual

Set the requirements for the pass.

Reimplemented from cacao::jit::compiler2::Pass.

Definition at line 1250 of file LinearScanAllocatorPass.cpp.

void LinearScanAllocatorPass::initialize ( )
virtual

Initialize the Pass.

This method is called by the PassManager before the pass is started. It should be used to initialize e.g. data structures. A Pass object might be reused so the construtor can not be used in some cases.

Reimplemented from cacao::jit::compiler2::Pass.

Definition at line 539 of file LinearScanAllocatorPass.cpp.

bool LinearScanAllocatorPass::order_and_insert_move ( EdgeMoveMapTy::value_type &  entry,
BBtoLTI_Map bb2lti_map 
)
private

Definition at line 1081 of file LinearScanAllocatorPass.cpp.

bool LinearScanAllocatorPass::reg_alloc_resolve_block ( MIIterator  first,
MIIterator  last 
)
private

calculate state sets

calculate intervals

Definition at line 1149 of file LinearScanAllocatorPass.cpp.

bool LinearScanAllocatorPass::resolve ( )
private

Definition at line 1194 of file LinearScanAllocatorPass.cpp.

bool LinearScanAllocatorPass::run ( JITData JD)
virtual

Run the Pass.

This method implements the compiler pass.

Returns
false if a problem occurred, true otherwise

Implements cacao::jit::compiler2::Pass.

Definition at line 659 of file LinearScanAllocatorPass.cpp.

bool LinearScanAllocatorPass::try_allocate_free ( LivetimeInterval current,
UseDef  pos 
)
inlineprivate

Definition at line 193 of file LinearScanAllocatorPass.cpp.

bool LinearScanAllocatorPass::verify ( ) const
virtual

Verify the Result.

This method is used to verify the result of the pass. It has the same motivation than the assert() statement. It should be only used for debugging purposes and might not be called in release builds.

Reimplemented from cacao::jit::compiler2::Pass.

Definition at line 1233 of file LinearScanAllocatorPass.cpp.

Field Documentation

ActiveSetTy cacao::jit::compiler2::LinearScanAllocatorPass::active
private

Definition at line 98 of file LinearScanAllocatorPass.hpp.

Backend* cacao::jit::compiler2::LinearScanAllocatorPass::backend
private

Definition at line 104 of file LinearScanAllocatorPass.hpp.

HandledSetTy cacao::jit::compiler2::LinearScanAllocatorPass::handled
private

Definition at line 100 of file LinearScanAllocatorPass.hpp.

char LinearScanAllocatorPass::ID = 0
static

Definition at line 116 of file LinearScanAllocatorPass.hpp.

InactiveSetTy cacao::jit::compiler2::LinearScanAllocatorPass::inactive
private

Definition at line 99 of file LinearScanAllocatorPass.hpp.

JITData* cacao::jit::compiler2::LinearScanAllocatorPass::jd
private

Definition at line 105 of file LinearScanAllocatorPass.hpp.

LivetimeAnalysisPass* cacao::jit::compiler2::LinearScanAllocatorPass::LA
private

Definition at line 102 of file LinearScanAllocatorPass.hpp.

MachineInstructionSchedule* cacao::jit::compiler2::LinearScanAllocatorPass::MIS
private

Definition at line 103 of file LinearScanAllocatorPass.hpp.

UnhandledSetTy cacao::jit::compiler2::LinearScanAllocatorPass::unhandled
private

Definition at line 97 of file LinearScanAllocatorPass.hpp.


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