lestes::backend_v2::workers::linscan_regalloc Class Reference

Provides a linearscan register allocation. More...

#include <linscan_regalloc.g.hh>

Inheritance diagram for lestes::backend_v2::workers::linscan_regalloc:

Inheritance graph
[legend]
List of all members.

Public Member Functions

ptr< ::lestes::std::vector<
srp< ::lestes::backend_v2::workers::alloc_interval > > > 
active_intervals_get () const
 The method active_intervals_get returns the value of the field linscan_regalloc::active_intervals.
void active_intervals_set (const ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > &)
 The method active_intervals_set sets the field linscan_regalloc::active_intervals to the given value.
ptr< ::lestes::std::vector<
srp< ::lestes::backend_v2::workers::alloc_interval > > > 
expired_intervals_get () const
 The method expired_intervals_get returns the value of the field linscan_regalloc::expired_intervals.
void expired_intervals_set (const ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > &)
 The method expired_intervals_set sets the field linscan_regalloc::expired_intervals to the given value.
ptr< ::lestes::std::vector<
srp< ::lestes::backend_v2::workers::alloc_interval > > > 
waiting_intervals_get () const
 The method waiting_intervals_get returns the value of the field linscan_regalloc::waiting_intervals.
void waiting_intervals_set (const ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > &)
 The method waiting_intervals_set sets the field linscan_regalloc::waiting_intervals to the given value.
ptr< ::lestes::std::map< ulint,
srp< ::lestes::backend_v2::workers::alloc_interval > > > 
register_owners_get () const
 The method register_owners_get returns the value of the field linscan_regalloc::register_owners.
void register_owners_set (const ptr< ::lestes::std::map< ulint, srp< ::lestes::backend_v2::workers::alloc_interval > > > &)
 The method register_owners_set sets the field linscan_regalloc::register_owners to the given value.
ptr< ::lestes::std::set< ulint > > free_registers_get () const
 The method free_registers_get returns the value of the field linscan_regalloc::free_registers.
void free_registers_set (const ptr< ::lestes::std::set< ulint > > &)
 The method free_registers_set sets the field linscan_regalloc::free_registers to the given value.
ptr< ::lestes::std::set< ulint > > used_registers_get () const
 The method used_registers_get returns the value of the field linscan_regalloc::used_registers.
void used_registers_set (const ptr< ::lestes::std::set< ulint > > &)
 The method used_registers_set sets the field linscan_regalloc::used_registers to the given value.
ptr< ::lestes::std::set< ulint > > all_registers_get () const
 The method all_registers_get returns the value of the field linscan_regalloc::all_registers.
void all_registers_set (const ptr< ::lestes::std::set< ulint > > &)
 The method all_registers_set sets the field linscan_regalloc::all_registers to the given value.
ptr< ::lestes::std::map< srp<
::lestes::backend_v2::intercode::ge_operand_reg >,
srp< ::lestes::md::registers::tm_register > > > 
destroyers_get () const
 The method destroyers_get returns the value of the field linscan_regalloc::destroyers.
void destroyers_set (const ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::ge_operand_reg >, srp< ::lestes::md::registers::tm_register > > > &)
 The method destroyers_set sets the field linscan_regalloc::destroyers to the given value.
void process ()
 Allocates registers to register operands.
ptr< ::lestes::backend_v2::structs::func_dataget_result ()
 Returns data of the currently processed function with result of the register allocation.
ptr< set< ulint > > ge_pi__get_allowed_regs_for_op (ptr< ::lestes::backend_v2::intercode::ge_pi > ge, ptr< ::lestes::backend_v2::intercode::ge_operand_reg > op)
ptr< ::lestes::md::instructions::tm_instr_op_reg_basege_pi__find_tm_op_by_ge_op (ptr< ::lestes::backend_v2::intercode::ge_pi > ge, ptr< ::lestes::backend_v2::intercode::ge_operand_reg > op)
ptr< ::lestes::md::registers::tm_registerget_free_register (ptr< ::lestes::backend_v2::workers::alloc_interval > interval)
void set_register_owner (ptr< ::lestes::md::registers::tm_register > reg, ptr< ::lestes::backend_v2::workers::alloc_interval > interval)
void expire_old_intervals (ptr< ::lestes::backend_v2::workers::alloc_interval > curr_interval)
void setup_registers ()
 Fills the all_registers set with all the available registers.
void find_free_registers ()
 Recomputes the free_registers set.
void set_registers_to_operands ()
 Sets allocated registers of intervals to operands.
void set_interval_dependencies ()
 Sets up dependencies amoung dependent intervals.
ptr< ::lestes::md::registers::tm_registerget_destroyed_register (ptr< ::lestes::backend_v2::intercode::ge_operand_reg > op)
void set_destroyed_register (ptr< ::lestes::backend_v2::intercode::ge_pi > ge, ptr< ::lestes::backend_v2::intercode::ge_operand_reg > op, ptr< ::lestes::md::registers::tm_register > reg)
virtual ptr< reflection_listreflection_get () const
 for purposes of dumping
virtual ptr< field_list_listfield_values_get () const
 for purposes of dumping

Static Public Member Functions

static ptr< linscan_regalloccreate (ptr< ::lestes::backend_v2::structs::func_data > a__worker_base__data, ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > a__linscan_regalloc__active_intervals, ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > a__linscan_regalloc__expired_intervals, ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > a__linscan_regalloc__waiting_intervals, ptr< ::lestes::std::map< ulint, srp< ::lestes::backend_v2::workers::alloc_interval > > > a__linscan_regalloc__register_owners, ptr< ::lestes::std::set< ulint > > a__linscan_regalloc__free_registers, ptr< ::lestes::std::set< ulint > > a__linscan_regalloc__used_registers, ptr< ::lestes::std::set< ulint > > a__linscan_regalloc__all_registers, ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::ge_operand_reg >, srp< ::lestes::md::registers::tm_register > > > a__linscan_regalloc__destroyers)
 First generated factory method for class linscan_regalloc.
static ptr< linscan_regalloccreate (ptr< ::lestes::backend_v2::structs::func_data > a__worker_base__data)
 Second generated factory method for class linscan_regalloc.

Protected Member Functions

 linscan_regalloc (ptr< ::lestes::backend_v2::structs::func_data > a__worker_base__data, ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > a__linscan_regalloc__active_intervals, ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > a__linscan_regalloc__expired_intervals, ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > a__linscan_regalloc__waiting_intervals, ptr< ::lestes::std::map< ulint, srp< ::lestes::backend_v2::workers::alloc_interval > > > a__linscan_regalloc__register_owners, ptr< ::lestes::std::set< ulint > > a__linscan_regalloc__free_registers, ptr< ::lestes::std::set< ulint > > a__linscan_regalloc__used_registers, ptr< ::lestes::std::set< ulint > > a__linscan_regalloc__all_registers, ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::ge_operand_reg >, srp< ::lestes::md::registers::tm_register > > > a__linscan_regalloc__destroyers)
 Generated constructor for class linscan_regalloc.
virtual void gc_mark ()
 Marking routine for class linscan_regalloc.

Private Attributes

srp< ::lestes::std::vector<
srp< ::lestes::backend_v2::workers::alloc_interval > > > 
active_intervals
 A list of active intervals.
srp< ::lestes::std::vector<
srp< ::lestes::backend_v2::workers::alloc_interval > > > 
expired_intervals
 A list of already processed intervals.
srp< ::lestes::std::vector<
srp< ::lestes::backend_v2::workers::alloc_interval > > > 
waiting_intervals
 A list of intervals witing for processing.
srp< ::lestes::std::map< ulint,
srp< ::lestes::backend_v2::workers::alloc_interval > > > 
register_owners
 A map that holds information about which interval has which register allocated.
srp< ::lestes::std::set< ulint > > free_registers
 A set of free registers.
srp< ::lestes::std::set< ulint > > used_registers
 A set of used registers.
srp< ::lestes::std::set< ulint > > all_registers
 A set of all the registers that machine description contains.
srp< ::lestes::std::map< srp<
::lestes::backend_v2::intercode::ge_operand_reg >,
srp< ::lestes::md::registers::tm_register > > > 
destroyers
 A map that holds information about whitch register is destroyed by which operand.

Static Private Attributes

static ptr< reflection_listreflection = reflection

Detailed Description

Provides a linearscan register allocation.


Constructor & Destructor Documentation

lestes::backend_v2::workers::linscan_regalloc::linscan_regalloc ( ptr< ::lestes::backend_v2::structs::func_data a__worker_base__data,
ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > >  a__linscan_regalloc__active_intervals,
ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > >  a__linscan_regalloc__expired_intervals,
ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > >  a__linscan_regalloc__waiting_intervals,
ptr< ::lestes::std::map< ulint, srp< ::lestes::backend_v2::workers::alloc_interval > > >  a__linscan_regalloc__register_owners,
ptr< ::lestes::std::set< ulint > >  a__linscan_regalloc__free_registers,
ptr< ::lestes::std::set< ulint > >  a__linscan_regalloc__used_registers,
ptr< ::lestes::std::set< ulint > >  a__linscan_regalloc__all_registers,
ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::ge_operand_reg >, srp< ::lestes::md::registers::tm_register > > >  a__linscan_regalloc__destroyers 
) [protected]

Generated constructor for class linscan_regalloc.

Generated constructor for class linscan_regalloc.

Author:
lsg


Member Function Documentation

ptr<::lestes::std::vector< srp<::lestes::backend_v2::workers::alloc_interval > > > lestes::backend_v2::workers::linscan_regalloc::active_intervals_get (  )  const

The method active_intervals_get returns the value of the field linscan_regalloc::active_intervals.

Returns:
The value of linscan_regalloc::active_intervals.
Author:
lsg

void lestes::backend_v2::workers::linscan_regalloc::active_intervals_set ( const ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > &  x  ) 

The method active_intervals_set sets the field linscan_regalloc::active_intervals to the given value.

Parameters:
[in] x The new value to set linscan_regalloc::active_intervals to.
Author:
lsg

ptr<::lestes::std::vector< srp<::lestes::backend_v2::workers::alloc_interval > > > lestes::backend_v2::workers::linscan_regalloc::expired_intervals_get (  )  const

The method expired_intervals_get returns the value of the field linscan_regalloc::expired_intervals.

Returns:
The value of linscan_regalloc::expired_intervals.
Author:
lsg

void lestes::backend_v2::workers::linscan_regalloc::expired_intervals_set ( const ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > &  x  ) 

The method expired_intervals_set sets the field linscan_regalloc::expired_intervals to the given value.

Parameters:
[in] x The new value to set linscan_regalloc::expired_intervals to.
Author:
lsg

ptr<::lestes::std::vector< srp<::lestes::backend_v2::workers::alloc_interval > > > lestes::backend_v2::workers::linscan_regalloc::waiting_intervals_get (  )  const

The method waiting_intervals_get returns the value of the field linscan_regalloc::waiting_intervals.

Returns:
The value of linscan_regalloc::waiting_intervals.
Author:
lsg

void lestes::backend_v2::workers::linscan_regalloc::waiting_intervals_set ( const ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > &  x  ) 

The method waiting_intervals_set sets the field linscan_regalloc::waiting_intervals to the given value.

Parameters:
[in] x The new value to set linscan_regalloc::waiting_intervals to.
Author:
lsg

ptr<::lestes::std::map< ulint, srp<::lestes::backend_v2::workers::alloc_interval > > > lestes::backend_v2::workers::linscan_regalloc::register_owners_get (  )  const

The method register_owners_get returns the value of the field linscan_regalloc::register_owners.

Returns:
The value of linscan_regalloc::register_owners.
Author:
lsg

void lestes::backend_v2::workers::linscan_regalloc::register_owners_set ( const ptr< ::lestes::std::map< ulint, srp< ::lestes::backend_v2::workers::alloc_interval > > > &  x  ) 

The method register_owners_set sets the field linscan_regalloc::register_owners to the given value.

Parameters:
[in] x The new value to set linscan_regalloc::register_owners to.
Author:
lsg

ptr<::lestes::std::set< ulint > > lestes::backend_v2::workers::linscan_regalloc::free_registers_get (  )  const

The method free_registers_get returns the value of the field linscan_regalloc::free_registers.

Returns:
The value of linscan_regalloc::free_registers.
Author:
lsg

void lestes::backend_v2::workers::linscan_regalloc::free_registers_set ( const ptr< ::lestes::std::set< ulint > > &  x  ) 

The method free_registers_set sets the field linscan_regalloc::free_registers to the given value.

Parameters:
[in] x The new value to set linscan_regalloc::free_registers to.
Author:
lsg

ptr<::lestes::std::set< ulint > > lestes::backend_v2::workers::linscan_regalloc::used_registers_get (  )  const

The method used_registers_get returns the value of the field linscan_regalloc::used_registers.

Returns:
The value of linscan_regalloc::used_registers.
Author:
lsg

void lestes::backend_v2::workers::linscan_regalloc::used_registers_set ( const ptr< ::lestes::std::set< ulint > > &  x  ) 

The method used_registers_set sets the field linscan_regalloc::used_registers to the given value.

Parameters:
[in] x The new value to set linscan_regalloc::used_registers to.
Author:
lsg

ptr<::lestes::std::set< ulint > > lestes::backend_v2::workers::linscan_regalloc::all_registers_get (  )  const

The method all_registers_get returns the value of the field linscan_regalloc::all_registers.

Returns:
The value of linscan_regalloc::all_registers.
Author:
lsg

void lestes::backend_v2::workers::linscan_regalloc::all_registers_set ( const ptr< ::lestes::std::set< ulint > > &  x  ) 

The method all_registers_set sets the field linscan_regalloc::all_registers to the given value.

Parameters:
[in] x The new value to set linscan_regalloc::all_registers to.
Author:
lsg

ptr<::lestes::std::map< srp<::lestes::backend_v2::intercode::ge_operand_reg >, srp<::lestes::md::registers::tm_register > > > lestes::backend_v2::workers::linscan_regalloc::destroyers_get (  )  const

The method destroyers_get returns the value of the field linscan_regalloc::destroyers.

Returns:
The value of linscan_regalloc::destroyers.
Author:
lsg

void lestes::backend_v2::workers::linscan_regalloc::destroyers_set ( const ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::ge_operand_reg >, srp< ::lestes::md::registers::tm_register > > > &  x  ) 

The method destroyers_set sets the field linscan_regalloc::destroyers to the given value.

Parameters:
[in] x The new value to set linscan_regalloc::destroyers to.
Author:
lsg

void lestes::backend_v2::workers::linscan_regalloc::process (  )  [virtual]

Allocates registers to register operands.

Implements lestes::backend_v2::workers::worker_base.

ptr<::lestes::backend_v2::structs::func_data > lestes::backend_v2::workers::linscan_regalloc::get_result (  )  [virtual]

Returns data of the currently processed function with result of the register allocation.

Implements lestes::backend_v2::workers::worker_base.

ptr<set<ulint> > lestes::backend_v2::workers::linscan_regalloc::ge_pi__get_allowed_regs_for_op ( ptr< ::lestes::backend_v2::intercode::ge_pi ge,
ptr< ::lestes::backend_v2::intercode::ge_operand_reg op 
)

ptr< ::lestes::md::instructions::tm_instr_op_reg_base > lestes::backend_v2::workers::linscan_regalloc::ge_pi__find_tm_op_by_ge_op ( ptr< ::lestes::backend_v2::intercode::ge_pi ge,
ptr< ::lestes::backend_v2::intercode::ge_operand_reg op 
)

ptr< ::lestes::md::registers::tm_register > lestes::backend_v2::workers::linscan_regalloc::get_free_register ( ptr< ::lestes::backend_v2::workers::alloc_interval interval  ) 

void lestes::backend_v2::workers::linscan_regalloc::set_register_owner ( ptr< ::lestes::md::registers::tm_register reg,
ptr< ::lestes::backend_v2::workers::alloc_interval interval 
)

void lestes::backend_v2::workers::linscan_regalloc::expire_old_intervals ( ptr< ::lestes::backend_v2::workers::alloc_interval curr_interval  ) 

void lestes::backend_v2::workers::linscan_regalloc::setup_registers (  ) 

Fills the all_registers set with all the available registers.

void lestes::backend_v2::workers::linscan_regalloc::find_free_registers (  ) 

Recomputes the free_registers set.

free_registers <- all_registers - used_registers

void lestes::backend_v2::workers::linscan_regalloc::set_registers_to_operands (  ) 

Sets allocated registers of intervals to operands.

void lestes::backend_v2::workers::linscan_regalloc::set_interval_dependencies (  ) 

Sets up dependencies amoung dependent intervals.

If two intervals uses the same register, it is needed to not allow them to overlap. It is done by setting dependence of a first pseudoinstruction of the second interval on a last pseudoinstruction of the second interval.

ptr< ::lestes::md::registers::tm_register > lestes::backend_v2::workers::linscan_regalloc::get_destroyed_register ( ptr< ::lestes::backend_v2::intercode::ge_operand_reg op  ) 

void lestes::backend_v2::workers::linscan_regalloc::set_destroyed_register ( ptr< ::lestes::backend_v2::intercode::ge_pi ge,
ptr< ::lestes::backend_v2::intercode::ge_operand_reg op,
ptr< ::lestes::md::registers::tm_register reg 
)

ptr< linscan_regalloc > lestes::backend_v2::workers::linscan_regalloc::create ( ptr< ::lestes::backend_v2::structs::func_data a__worker_base__data,
ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > >  a__linscan_regalloc__active_intervals,
ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > >  a__linscan_regalloc__expired_intervals,
ptr< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > >  a__linscan_regalloc__waiting_intervals,
ptr< ::lestes::std::map< ulint, srp< ::lestes::backend_v2::workers::alloc_interval > > >  a__linscan_regalloc__register_owners,
ptr< ::lestes::std::set< ulint > >  a__linscan_regalloc__free_registers,
ptr< ::lestes::std::set< ulint > >  a__linscan_regalloc__used_registers,
ptr< ::lestes::std::set< ulint > >  a__linscan_regalloc__all_registers,
ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::ge_operand_reg >, srp< ::lestes::md::registers::tm_register > > >  a__linscan_regalloc__destroyers 
) [static]

First generated factory method for class linscan_regalloc.

This factory method for class linscan_regalloc takes values of all fields as arguments.

Author:
lsg

ptr< linscan_regalloc > lestes::backend_v2::workers::linscan_regalloc::create ( ptr< ::lestes::backend_v2::structs::func_data a__worker_base__data  )  [static]

Second generated factory method for class linscan_regalloc.

This factory method for class linscan_regalloc uses initializers.

Author:
lsg

ptr< object::reflection_list > lestes::backend_v2::workers::linscan_regalloc::reflection_get (  )  const [virtual]

for purposes of dumping

Reimplemented from lestes::backend_v2::workers::worker_base.

ptr< object::field_list_list > lestes::backend_v2::workers::linscan_regalloc::field_values_get (  )  const [virtual]

for purposes of dumping

Reimplemented from lestes::backend_v2::workers::worker_base.

void lestes::backend_v2::workers::linscan_regalloc::gc_mark ( void   )  [protected, virtual]

Marking routine for class linscan_regalloc.

Marking routine is used for garbage collection.

Author:
lsg

Reimplemented from lestes::backend_v2::workers::worker_base.


Member Data Documentation

srp< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > lestes::backend_v2::workers::linscan_regalloc::active_intervals [private]

A list of active intervals.

srp< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > lestes::backend_v2::workers::linscan_regalloc::expired_intervals [private]

A list of already processed intervals.

srp< ::lestes::std::vector< srp< ::lestes::backend_v2::workers::alloc_interval > > > lestes::backend_v2::workers::linscan_regalloc::waiting_intervals [private]

A list of intervals witing for processing.

srp< ::lestes::std::map< ulint, srp< ::lestes::backend_v2::workers::alloc_interval > > > lestes::backend_v2::workers::linscan_regalloc::register_owners [private]

A map that holds information about which interval has which register allocated.

srp< ::lestes::std::set< ulint > > lestes::backend_v2::workers::linscan_regalloc::free_registers [private]

A set of free registers.

srp< ::lestes::std::set< ulint > > lestes::backend_v2::workers::linscan_regalloc::used_registers [private]

A set of used registers.

srp< ::lestes::std::set< ulint > > lestes::backend_v2::workers::linscan_regalloc::all_registers [private]

A set of all the registers that machine description contains.

srp< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::ge_operand_reg >, srp< ::lestes::md::registers::tm_register > > > lestes::backend_v2::workers::linscan_regalloc::destroyers [private]

A map that holds information about whitch register is destroyed by which operand.

ptr< object::reflection_list > lestes::backend_v2::workers::linscan_regalloc::reflection = reflection [static, private]

Reimplemented from lestes::backend_v2::workers::worker_base.


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:43:15 2007 for lestes by doxygen 1.5.1-20070107