CACAO
Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes
cacao::jit::compiler2::LoopPassBase< _T > Class Template Reference

Calculate the Loop Tree. More...

Inheritance diagram for cacao::jit::compiler2::LoopPassBase< _T >:
cacao::jit::compiler2::Pass cacao::jit::compiler2::memory::ManagerMixin< LoopPassBase< _T > > cacao::jit::compiler2::LoopTreeBase< _T >

Public Member Functions

 LoopPassBase ()
 
virtual bool run (JITData &JD)
 Run the Pass. More...
 
virtual PassUsageget_PassUsage (PassUsage &PU) const
 Set the requirements for the pass. 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 initialize ()
 Initialize the Pass. More...
 
virtual void finalize ()
 Finalize the Pass. More...
 
virtual bool verify () const
 Verify the Result. More...
 
virtual ~Pass ()
 Destructor. More...
 
- Public Member Functions inherited from cacao::jit::compiler2::LoopTreeBase< _T >
 LoopTreeBase ()
 
bool is_reducible () const
 
LoopTypeadd_loop (NodeType *header, NodeType *exit)
 
void add_top_loop (LoopType *loop)
 
loop_iterator loop_begin ()
 
loop_iterator loop_end ()
 
LoopTypeget_Loop (NodeType *BI) const
 Get the inner most loop which contains BI or NULL if not contained in any loop. More...
 
bool is_loop_header (NodeType *BI) const
 
ConstLoopIteratorPair get_Loops_from_header (NodeType *BI) const
 
bool is_backedge (NodeType *src, NodeType *header) const
 
bool is_inner_loop (LoopType *inner, LoopType *outer) const
 Test if a loop is a strictly inner loop of another loop. More...
 
int loop_nest (LoopType *loop) const
 TODO: cache? More...
 
virtual ~LoopTreeBase ()
 

Static Public Attributes

static char ID = 0
 

Private Types

typedef _T NodeType
 
typedef alloc::set< const
NodeType * >::type 
NodeListTy
 
typedef alloc::map< const
NodeType *, NodeListTy >::type 
NodeListMapTy
 
typedef alloc::vector< const
NodeType * >::type 
NodeMapTy
 
typedef alloc::map< const
NodeType *, int >::type 
IndexMapTy
 
typedef alloc::map< const
NodeType *, const NodeType * >
::type 
EdgeMapTy
 

Private Member Functions

NodeListTysucc (const NodeType *v, NodeListTy &list)
 
NodeTypeget_init_node (JITData &JD)
 

Private Attributes

NodeListMapTy bucket
 
IndexMapTy semi
 
NodeMapTy vertex
 
int n
 
EdgeMapTy ancestor
 
EdgeMapTy label
 

Additional Inherited Members

- Public Types inherited from cacao::jit::compiler2::LoopTreeBase< _T >
typedef _T NodeType
 
typedef LoopBase< NodeTypeLoopType
 
typedef LoopType::LoopSetTy LoopSetTy
 
typedef LoopSetTy::iterator loop_iterator
 
typedef LoopSetTy::const_iterator const_loop_iterator
 
typedef std::pair
< const_loop_iterator,
const_loop_iterator
ConstLoopIteratorPair
 
typedef alloc::vector
< LoopType * >::type 
LoopListTy
 
typedef LoopListTy::iterator iterator
 
typedef
LoopListTy::reverse_iterator 
reverse_iterator
 
- Static Public Member Functions inherited from cacao::jit::compiler2::memory::ManagerMixin< LoopPassBase< _T > >
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...
 
- Protected Member Functions inherited from cacao::jit::compiler2::LoopTreeBase< _T >
void set_loop (NodeType *node, LoopType *loop)
 
void insert_loop_header (NodeType *node, LoopType *loop)
 
iterator begin ()
 
iterator end ()
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
- Protected Attributes inherited from cacao::jit::compiler2::LoopTreeBase< _T >
bool reducible
 
LoopListTy loops
 
LoopSetTy top_loops
 
alloc::map< NodeType
*, LoopType * >::type 
loop_map
 
alloc::map< NodeType
*, LoopSetTy >::type 
loop_header_map
 

Detailed Description

template<class _T>
class cacao::jit::compiler2::LoopPassBase< _T >

Calculate the Loop Tree.

The algorithm used here is based on the method proposed in "Testing Flow Graph Reducibility" by Tarjan [9] with the modifications in "SSA-Based Reduction of Operator Strengh" by Vick [10]. See also Click's Phd Thesis, Chapter 6 [2].

Definition at line 53 of file LoopPassBase.hpp.

Member Typedef Documentation

template<class _T >
typedef alloc::map<const NodeType *,const NodeType *>::type cacao::jit::compiler2::LoopPassBase< _T >::EdgeMapTy
private

Definition at line 60 of file LoopPassBase.hpp.

template<class _T >
typedef alloc::map<const NodeType *,int>::type cacao::jit::compiler2::LoopPassBase< _T >::IndexMapTy
private

Definition at line 59 of file LoopPassBase.hpp.

template<class _T >
typedef alloc::map<const NodeType *,NodeListTy>::type cacao::jit::compiler2::LoopPassBase< _T >::NodeListMapTy
private

Definition at line 57 of file LoopPassBase.hpp.

template<class _T >
typedef alloc::set<const NodeType *>::type cacao::jit::compiler2::LoopPassBase< _T >::NodeListTy
private

Definition at line 56 of file LoopPassBase.hpp.

template<class _T >
typedef alloc::vector<const NodeType *>::type cacao::jit::compiler2::LoopPassBase< _T >::NodeMapTy
private

Definition at line 58 of file LoopPassBase.hpp.

template<class _T >
typedef _T cacao::jit::compiler2::LoopPassBase< _T >::NodeType
private

Definition at line 55 of file LoopPassBase.hpp.

Constructor & Destructor Documentation

template<class _T >
cacao::jit::compiler2::LoopPassBase< _T >::LoopPassBase ( )
inline

Definition at line 86 of file LoopPassBase.hpp.

Member Function Documentation

MachineLoopPass::NodeType * cacao::jit::compiler2::MachineLoopPass::get_init_node ( JITData JD)
private

Definition at line 40 of file LoopPass.cpp.

PassUsage & cacao::jit::compiler2::MachineLoopPass::get_PassUsage ( PassUsage PU) const
virtual

Set the requirements for the pass.

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

Definition at line 34 of file LoopPass.cpp.

template<class _T >
bool cacao::jit::compiler2::LoopPassBase< _T >::run ( JITData JD)
inlinevirtual

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 109 of file LoopPassBase.hpp.

template<class _T >
NodeListTy& cacao::jit::compiler2::LoopPassBase< _T >::succ ( const NodeType v,
NodeListTy list 
)
private

Field Documentation

template<class _T >
EdgeMapTy cacao::jit::compiler2::LoopPassBase< _T >::ancestor
private

Definition at line 71 of file LoopPassBase.hpp.

template<class _T >
NodeListMapTy cacao::jit::compiler2::LoopPassBase< _T >::bucket
private

Definition at line 66 of file LoopPassBase.hpp.

template<class _T >
char cacao::jit::compiler2::MachineLoopPass::ID = 0
static

Definition at line 85 of file LoopPassBase.hpp.

template<class _T >
EdgeMapTy cacao::jit::compiler2::LoopPassBase< _T >::label
private

Definition at line 72 of file LoopPassBase.hpp.

template<class _T >
int cacao::jit::compiler2::LoopPassBase< _T >::n
private

Definition at line 69 of file LoopPassBase.hpp.

template<class _T >
IndexMapTy cacao::jit::compiler2::LoopPassBase< _T >::semi
private

Definition at line 67 of file LoopPassBase.hpp.

template<class _T >
NodeMapTy cacao::jit::compiler2::LoopPassBase< _T >::vertex
private

Definition at line 68 of file LoopPassBase.hpp.


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