GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
jit_block Class Reference

#include "jit-ir.h"

Inheritance diagram for jit_block:
Inheritance graph
[legend]
Collaboration diagram for jit_block:
Collaboration graph
[legend]

Public Types

typedef
instruction_list::const_iterator 
const_iterator
 
typedef df_set::const_iterator df_iterator
 
typedef std::set< jit_block * > df_set
 
typedef std::list
< jit_instruction * > 
instruction_list
 
typedef instruction_list::iterator iterator
 

Public Member Functions

 jit_block (const std::string &aname, size_t avisit_count=0)
 
virtual void accept (jit_ir_walker &walker)
 
bool alive (void) const
 
template<typename T >
T * append (T *instr)
 
jit_instructionback (void)
 
iterator begin (void)
 
const_iterator begin (void) const
 
bool branch_alive (jit_block *asucc) const
 
void compute_df (void)
 
void compute_idom (jit_block &entry_block)
 
void create_dom_tree (void)
 
const df_setdf (void) const
 
df_iterator df_begin (void) const
 
df_iterator df_end (void) const
 
jit_blockdom_successor (size_t idx) const
 
size_t dom_successor_count (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
jit_usefirst_use (void) const
 
jit_blockfirst_use_block (void)
 
jit_instructionfront (void)
 
bool has_llvm (void) const
 
size_t id (void) const
 
bool in_worklist (void) const
 
jit_instructioninsert_after (iterator loc, jit_instruction *instr)
 
jit_instructioninsert_after (jit_instruction *loc, jit_instruction *instr)
 
jit_instructioninsert_before (iterator loc, jit_instruction *instr)
 
jit_instructioninsert_before (jit_instruction *loc, jit_instruction *instr)
 
void label (void)
 
void label (size_t avisit_count, size_t &number)
 
jit_instructionlast_use (void) const
 
std::list< jit_block * >::iterator location (void) const
 
void mark_alive (void)
 
jit_blockmaybe_merge ()
 
jit_blockmaybe_split (jit_factory &factory, jit_block_list &blocks, jit_block *asuccessor)
 
jit_blockmaybe_split (jit_factory &factory, jit_block_list &blocks, jit_block &asuccessor)
 
void merge (jit_block &merge)
 
const std::string & name (void) const
 
virtual bool needs_release (void) const
 
iterator nonphi_begin (void)
 
iterator phi_begin (void)
 
iterator phi_end (void)
 
void pop_all (void)
 
jit_instructionprepend (jit_instruction *instr)
 
jit_instructionprepend_after_phi (jit_instruction *instr)
 
virtual std::ostream & print (std::ostream &os, size_t indent=0) const
 
std::ostream & print_dom (std::ostream &os) const
 
std::string print_string (void)
 
iterator remove (iterator iter)
 
void replace_in_phi (jit_block *ablock, jit_block *with)
 
virtual void replace_with (jit_value *value)
 
virtual std::ostream & short_print (std::ostream &os) const
 
void stash_in_worklist (bool ain_worklist)
 
void stash_last_use (jit_instruction *alast_use)
 
void stash_llvm (llvm::Value *compiled)
 
void stash_location (std::list< jit_block * >::iterator alocation)
 
void stash_type (jit_type *new_ty)
 
jit_blocksuccessor (size_t i) const
 
size_t successor_count (void) const
 
jit_terminatorterminator (void) const
 
llvm::BasicBlock * to_llvm (void) const
 
jit_typetype (void) const
 
llvm::Type * type_llvm (void) const
 
const std::string & type_name (void) const
 
size_t use_count (void) const
 
size_t visit_count (void) const
 
bool visited (size_t avisit_count)
 

Static Public Attributes

static const size_t NO_ID = static_cast<size_t> (-1)
 

Protected Member Functions

std::ostream & print_indent (std::ostream &os, size_t indent=0) const
 

Protected Attributes

llvm::Value * llvm_value
 

Private Types

typedef jit_internal_list
< jit_block, jit_phi_incomming
ILIST_T
 

Private Member Functions

void compute_df (size_t avisit_count)
 
void create_dom_tree (size_t avisit_count)
 
void internal_append (jit_instruction *instr)
 
bool update_idom (size_t avisit_count)
 

Static Private Member Functions

static jit_blockidom_intersect (jit_block *i, jit_block *j)
 

Private Attributes

std::vector< jit_block * > dom_succ
 
jit_blockidom
 
instruction_list instructions
 
bool malive
 
df_set mdf
 
size_t mid
 
std::list< jit_block * >::iterator mlocation
 
std::string mname
 
size_t mvisit_count
 

Detailed Description

Definition at line 535 of file jit-ir.h.

Member Typedef Documentation

typedef instruction_list::const_iterator jit_block::const_iterator

Definition at line 543 of file jit-ir.h.

typedef df_set::const_iterator jit_block::df_iterator

Definition at line 546 of file jit-ir.h.

typedef std::set<jit_block *> jit_block::df_set

Definition at line 545 of file jit-ir.h.

Definition at line 539 of file jit-ir.h.

Definition at line 541 of file jit-ir.h.

typedef instruction_list::iterator jit_block::iterator

Definition at line 542 of file jit-ir.h.

Constructor & Destructor Documentation

jit_block::jit_block ( const std::string &  aname,
size_t  avisit_count = 0 
)
inline

Definition at line 550 of file jit-ir.h.

Member Function Documentation

void jit_block::accept ( jit_ir_walker walker)
virtual

Implements jit_value.

Definition at line 185 of file jit-ir.cc.

bool jit_block::alive ( void  ) const
inline

Definition at line 565 of file jit-ir.h.

Referenced by jit_phi::infer(), maybe_split(), and jit_infer::remove_dead().

template<typename T >
T* jit_block::append ( T *  instr)
inline
jit_instruction* jit_block::back ( void  )
inline

Definition at line 738 of file jit-ir.h.

Referenced by jit_block_list::begin(), and jit_convert_llvm::convert_function().

iterator jit_block::begin ( void  )
inline
const_iterator jit_block::begin ( void  ) const
inline

Definition at line 621 of file jit-ir.h.

bool jit_block::branch_alive ( jit_block asucc) const

Definition at line 372 of file jit-ir.cc.

References jit_terminator::alive(), and terminator().

Referenced by jit_phi::infer(), and jit_phi::prune().

void jit_block::compute_df ( void  )
inline

Definition at line 665 of file jit-ir.h.

References idom.

Referenced by compute_df(), and jit_infer::construct_ssa().

void jit_block::compute_df ( size_t  avisit_count)
private
void jit_block::compute_idom ( jit_block entry_block)
inline

Definition at line 655 of file jit-ir.h.

Referenced by jit_infer::construct_ssa().

void jit_block::create_dom_tree ( void  )
inline

Definition at line 670 of file jit-ir.h.

Referenced by jit_infer::construct_ssa(), and create_dom_tree().

void jit_block::create_dom_tree ( size_t  avisit_count)
private

Definition at line 565 of file jit-ir.cc.

References create_dom_tree(), dom_succ, idom, successor(), successor_count(), and visited().

const df_set& jit_block::df ( void  ) const
inline

Definition at line 637 of file jit-ir.h.

df_iterator jit_block::df_begin ( void  ) const
inline

Definition at line 639 of file jit-ir.h.

Referenced by jit_infer::construct_ssa(), and print_dom().

df_iterator jit_block::df_end ( void  ) const
inline

Definition at line 641 of file jit-ir.h.

Referenced by jit_infer::construct_ssa(), and print_dom().

jit_block* jit_block::dom_successor ( size_t  idx) const
inline

Definition at line 675 of file jit-ir.h.

Referenced by jit_infer::do_construct_ssa().

size_t jit_block::dom_successor_count ( void  ) const
inline

Definition at line 680 of file jit-ir.h.

Referenced by jit_infer::do_construct_ssa().

iterator jit_block::end ( void  )
inline
const_iterator jit_block::end ( void  ) const
inline

Definition at line 625 of file jit-ir.h.

jit_use* jit_block::first_use ( void  ) const
inline

Definition at line 560 of file jit-ir.h.

Referenced by compute_df(), label(), print(), print_dom(), and update_idom().

jit_block * jit_value::first_use_block ( void  )
inherited
jit_instruction* jit_block::front ( void  )
inline

Definition at line 736 of file jit-ir.h.

bool jit_value::has_llvm ( void  ) const
inlineinherited

Definition at line 245 of file jit-ir.h.

References jit_value::print().

size_t jit_block::id ( void  ) const
inline

Definition at line 634 of file jit-ir.h.

Referenced by idom_intersect(), and jit_infer::place_releases().

jit_block * jit_block::idom_intersect ( jit_block i,
jit_block j 
)
staticprivate

Definition at line 578 of file jit-ir.cc.

References id(), and idom.

Referenced by update_idom().

bool jit_value::in_worklist ( void  ) const
inlineinherited

Definition at line 191 of file jit-ir.h.

Referenced by jit_infer::push_worklist().

jit_instruction * jit_block::insert_after ( iterator  loc,
jit_instruction instr 
)

Definition at line 352 of file jit-ir.cc.

References instructions, loc, and jit_instruction::stash_parent().

Referenced by jit_infer::release_temp().

jit_instruction* jit_block::insert_after ( jit_instruction loc,
jit_instruction instr 
)
inline

Definition at line 597 of file jit-ir.h.

jit_instruction * jit_block::insert_before ( iterator  loc,
jit_instruction instr 
)
jit_instruction* jit_block::insert_before ( jit_instruction loc,
jit_instruction instr 
)
inline

Definition at line 590 of file jit-ir.h.

void jit_block::internal_append ( jit_instruction instr)
private

Definition at line 337 of file jit-ir.cc.

References instructions, and jit_instruction::stash_parent().

void jit_block::label ( void  )
inline

Definition at line 644 of file jit-ir.h.

References jit_instruction::mid.

Referenced by jit_block_list::label(), and label().

void jit_block::label ( size_t  avisit_count,
size_t number 
)
jit_instruction* jit_value::last_use ( void  ) const
inlineinherited

Definition at line 229 of file jit-ir.h.

std::list<jit_block *>::iterator jit_block::location ( void  ) const
inline

Definition at line 714 of file jit-ir.h.

Referenced by jit_block_list::insert_after(), and jit_block_list::insert_before().

void jit_block::mark_alive ( void  )
inline

Definition at line 567 of file jit-ir.h.

Referenced by jit_terminator::infer(), jit_convert::initialize(), and maybe_split().

jit_block * jit_block::maybe_merge ( )

Definition at line 268 of file jit-ir.cc.

References instructions, merge(), successor(), successor_count(), and use_count().

jit_block * jit_block::maybe_split ( jit_factory factory,
jit_block_list blocks,
jit_block asuccessor 
)
jit_block* jit_block::maybe_split ( jit_factory factory,
jit_block_list blocks,
jit_block asuccessor 
)
inline

Definition at line 693 of file jit-ir.h.

void jit_block::merge ( jit_block merge)
const std::string& jit_block::name ( void  ) const
inline
virtual bool jit_value::needs_release ( void  ) const
inlinevirtualinherited

Reimplemented in jit_call.

Definition at line 236 of file jit-ir.h.

References jit_value::mlast_use.

Referenced by jit_infer::release_dead_phi(), and jit_infer::release_temp().

iterator jit_block::nonphi_begin ( void  )
iterator jit_block::phi_begin ( void  )
iterator jit_block::phi_end ( void  )
void jit_block::pop_all ( void  )

Definition at line 504 of file jit-ir.cc.

References begin(), end(), and jit_instruction::pop_variable().

Referenced by jit_infer::do_construct_ssa().

jit_instruction * jit_block::prepend ( jit_instruction instr)
jit_instruction * jit_block::prepend_after_phi ( jit_instruction instr)

Definition at line 320 of file jit-ir.cc.

References append(), begin(), end(), and insert_before().

std::ostream & jit_block::print ( std::ostream &  os,
size_t  indent = 0 
) const
virtual
std::ostream & jit_block::print_dom ( std::ostream &  os) const
std::ostream& jit_value::print_indent ( std::ostream &  os,
size_t  indent = 0 
) const
inlineprotectedinherited
std::string jit_value::print_string ( void  )
inlineinherited

Definition at line 222 of file jit-ir.h.

iterator jit_block::remove ( iterator  iter)
inline

Definition at line 602 of file jit-ir.h.

Referenced by jit_instruction::remove(), and jit_infer::remove_dead().

void jit_block::replace_in_phi ( jit_block ablock,
jit_block with 
)
void jit_block::replace_with ( jit_value value)
virtual
virtual std::ostream& jit_block::short_print ( std::ostream &  os) const
inlinevirtual

Reimplemented from jit_value.

Definition at line 702 of file jit-ir.h.

Referenced by print(), and print_dom().

void jit_value::stash_in_worklist ( bool  ain_worklist)
inlineinherited

Definition at line 196 of file jit-ir.h.

References jit_value::min_worklist.

Referenced by jit_infer::infer(), and jit_infer::push_worklist().

void jit_value::stash_last_use ( jit_instruction alast_use)
inlineinherited

Definition at line 231 of file jit-ir.h.

void jit_value::stash_llvm ( llvm::Value *  compiled)
inlineinherited
void jit_block::stash_location ( std::list< jit_block * >::iterator  alocation)
inline

Definition at line 717 of file jit-ir.h.

Referenced by jit_block_list::insert_before(), and jit_block_list::push_back().

void jit_value::stash_type ( jit_type new_ty)
inlineinherited
jit_block * jit_block::successor ( size_t  i) const
size_t jit_block::successor_count ( void  ) const
jit_terminator * jit_block::terminator ( void  ) const
llvm::BasicBlock * jit_block::to_llvm ( void  ) const
jit_type* jit_value::type ( void  ) const
inlineinherited
llvm::Type* jit_value::type_llvm ( void  ) const
inlineinherited

Definition at line 210 of file jit-ir.h.

Referenced by jit_convert_llvm::visit().

const std::string& jit_value::type_name ( void  ) const
inlineinherited

Definition at line 215 of file jit-ir.h.

References jit_type::to_llvm(), and jit_value::ty.

bool jit_block::update_idom ( size_t  avisit_count)
private
size_t jit_block::use_count ( void  ) const
inline

Definition at line 562 of file jit-ir.h.

Referenced by compute_df(), jit_infer::construct_ssa(), maybe_merge(), and update_idom().

size_t jit_block::visit_count ( void  ) const
inline

Definition at line 721 of file jit-ir.h.

bool jit_block::visited ( size_t  avisit_count)
inline

Member Data Documentation

std::vector<jit_block *> jit_block::dom_succ
private

Definition at line 756 of file jit-ir.h.

Referenced by create_dom_tree(), and print_dom().

jit_block* jit_block::idom
private

Definition at line 754 of file jit-ir.h.

Referenced by compute_df(), create_dom_tree(), idom_intersect(), print_dom(), and update_idom().

instruction_list jit_block::instructions
private
llvm::Value* jit_value::llvm_value
protectedinherited
bool jit_block::malive
private

Definition at line 759 of file jit-ir.h.

df_set jit_block::mdf
private

Definition at line 755 of file jit-ir.h.

Referenced by compute_df().

size_t jit_block::mid
private

Definition at line 753 of file jit-ir.h.

Referenced by label(), and print_dom().

std::list<jit_block *>::iterator jit_block::mlocation
private

Definition at line 760 of file jit-ir.h.

std::string jit_block::mname
private

Definition at line 757 of file jit-ir.h.

size_t jit_block::mvisit_count
private

Definition at line 752 of file jit-ir.h.

Referenced by maybe_split().

const size_t jit_block::NO_ID = static_cast<size_t> (-1)
static

Definition at line 548 of file jit-ir.h.

Referenced by jit_infer::place_releases().


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