GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::jit_block Class Reference

#include "jit-ir.h"

Inheritance diagram for octave::jit_block:
Collaboration diagram for octave::jit_block:

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 (size_t avisit_count, size_t &number)
 
void label (void)
 
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_type)
 
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 * m_llvm_value
 

Private Types

typedef jit_internal_list< jit_block, jit_phi_incomingILIST_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

bool m_alive
 
df_set m_df
 
std::vector< jit_block * > m_dom_succ
 
size_t m_id
 
jit_blockm_idom
 
bool m_in_worklist
 
instruction_list m_instructions
 
jit_instructionm_last_use
 
std::list< jit_block * >::iterator m_location
 
std::string m_name
 
jit_typem_type
 
size_t m_use_count
 
jit_usem_use_head
 
jit_usem_use_tail
 
size_t m_visit_count
 

Detailed Description

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

Member Typedef Documentation

◆ const_iterator

typedef instruction_list::const_iterator octave::jit_block::const_iterator

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

◆ df_iterator

typedef df_set::const_iterator octave::jit_block::df_iterator

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

◆ df_set

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

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

◆ ILIST_T

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

◆ instruction_list

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

◆ iterator

typedef instruction_list::iterator octave::jit_block::iterator

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

Constructor & Destructor Documentation

◆ jit_block()

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

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

Member Function Documentation

◆ accept()

void octave::jit_block::accept ( jit_ir_walker walker)
virtual

Implements octave::jit_value.

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

◆ alive()

bool octave::jit_block::alive ( void  ) const
inline

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

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

◆ append()

◆ back()

jit_instruction* octave::jit_block::back ( void  )
inline

◆ begin() [1/2]

◆ begin() [2/2]

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

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

◆ branch_alive()

bool octave::jit_block::branch_alive ( jit_block asucc) const

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

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

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

◆ compute_df() [1/2]

void octave::jit_block::compute_df ( size_t  avisit_count)
private

◆ compute_df() [2/2]

void octave::jit_block::compute_df ( void  )
inline

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

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

◆ compute_idom()

void octave::jit_block::compute_idom ( jit_block entry_block)
inline

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

References m_idom.

Referenced by octave::jit_infer::construct_ssa().

◆ create_dom_tree() [1/2]

void octave::jit_block::create_dom_tree ( size_t  avisit_count)
private

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

References create_dom_tree(), m_dom_succ, m_idom, successor(), successor_count(), and visited().

◆ create_dom_tree() [2/2]

void octave::jit_block::create_dom_tree ( void  )
inline

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

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

◆ df()

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

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

◆ df_begin()

df_iterator octave::jit_block::df_begin ( void  ) const
inline

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

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

◆ df_end()

df_iterator octave::jit_block::df_end ( void  ) const
inline

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

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

◆ dom_successor()

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

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

Referenced by octave::jit_infer::do_construct_ssa().

◆ dom_successor_count()

size_t octave::jit_block::dom_successor_count ( void  ) const
inline

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

Referenced by octave::jit_infer::do_construct_ssa().

◆ end() [1/2]

◆ end() [2/2]

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

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

◆ first_use()

jit_use* octave::jit_block::first_use ( void  ) const
inline

◆ first_use_block()

◆ front()

jit_instruction* octave::jit_block::front ( void  )
inline

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

Referenced by octave::jit_infer::construct_ssa(), and octave::jit_block_list::front().

◆ has_llvm()

bool octave::jit_value::has_llvm ( void  ) const
inlineinherited

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

◆ id()

size_t octave::jit_block::id ( void  ) const
inline

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

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

◆ idom_intersect()

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

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

References id(), and m_idom.

Referenced by update_idom().

◆ in_worklist()

bool octave::jit_value::in_worklist ( void  ) const
inlineinherited

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

Referenced by octave::jit_infer::push_worklist().

◆ insert_after() [1/2]

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

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

References loc, m_instructions, and octave::jit_instruction::stash_parent().

Referenced by octave::jit_infer::release_temp().

◆ insert_after() [2/2]

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

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

References loc.

◆ insert_before() [1/2]

◆ insert_before() [2/2]

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

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

References loc.

◆ internal_append()

void octave::jit_block::internal_append ( jit_instruction instr)
private

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

References m_instructions, and octave::jit_instruction::stash_parent().

◆ label() [1/2]

void octave::jit_block::label ( size_t  avisit_count,
size_t &  number 
)

◆ label() [2/2]

void octave::jit_block::label ( void  )
inline

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

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

◆ last_use()

jit_instruction* octave::jit_value::last_use ( void  ) const
inlineinherited

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

◆ location()

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

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

◆ mark_alive()

void octave::jit_block::mark_alive ( void  )
inline

◆ maybe_merge()

jit_block * octave::jit_block::maybe_merge ( void  )

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

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

◆ maybe_split() [1/2]

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

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

◆ maybe_split() [2/2]

◆ merge()

void octave::jit_block::merge ( jit_block merge)

◆ name()

const std::string& octave::jit_block::name ( void  ) const
inline

◆ needs_release()

virtual bool octave::jit_value::needs_release ( void  ) const
inlinevirtualinherited

Reimplemented in octave::jit_call.

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

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

◆ nonphi_begin()

iterator octave::jit_block::nonphi_begin ( void  )

◆ phi_begin()

iterator octave::jit_block::phi_begin ( void  )

◆ phi_end()

iterator octave::jit_block::phi_end ( void  )

◆ pop_all()

void octave::jit_block::pop_all ( void  )

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

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

Referenced by octave::jit_infer::do_construct_ssa().

◆ prepend()

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

◆ prepend_after_phi()

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

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

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

◆ print()

std::ostream & octave::jit_block::print ( std::ostream &  os,
size_t  indent = 0 
) const
virtual

◆ print_dom()

std::ostream & octave::jit_block::print_dom ( std::ostream &  os) const

◆ print_indent()

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

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

Referenced by print(), octave::jit_error_check::print(), and octave::jit_magic_end::print().

◆ print_string()

std::string octave::jit_value::print_string ( void  )
inlineinherited

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

◆ remove()

iterator octave::jit_block::remove ( iterator  iter)
inline

◆ replace_in_phi()

◆ replace_with()

void octave::jit_block::replace_with ( jit_value value)
virtual

◆ short_print()

virtual std::ostream& octave::jit_block::short_print ( std::ostream &  os) const
inlinevirtual

Reimplemented from octave::jit_value.

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

Referenced by print(), and print_dom().

◆ stash_in_worklist()

void octave::jit_value::stash_in_worklist ( bool  ain_worklist)
inlineinherited

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

Referenced by octave::jit_infer::push_worklist().

◆ stash_last_use()

void octave::jit_value::stash_last_use ( jit_instruction alast_use)
inlineinherited

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

◆ stash_llvm()

void octave::jit_value::stash_llvm ( llvm::Value *  compiled)
inlineinherited

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

Referenced by octave::jit_convert_llvm::convert(), and octave::jit_convert_llvm::visit().

◆ stash_location()

void octave::jit_block::stash_location ( std::list< jit_block * >::iterator  alocation)
inline

◆ stash_type()

void octave::jit_value::stash_type ( jit_type new_type)
inlineinherited

◆ successor()

jit_block * octave::jit_block::successor ( size_t  i) const

◆ successor_count()

size_t octave::jit_block::successor_count ( void  ) const

◆ terminator()

◆ to_llvm()

llvm::BasicBlock * octave::jit_block::to_llvm ( void  ) const

◆ type()

◆ type_llvm()

llvm::Type* octave::jit_value::type_llvm ( void  ) const
inlineinherited

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

Referenced by octave::jit_convert_llvm::visit().

◆ type_name()

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

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

◆ update_idom()

bool octave::jit_block::update_idom ( size_t  avisit_count)
private

◆ use_count()

size_t octave::jit_block::use_count ( void  ) const
inline

◆ visit_count()

size_t octave::jit_block::visit_count ( void  ) const
inline

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

◆ visited()

bool octave::jit_block::visited ( size_t  avisit_count)
inline

Member Data Documentation

◆ m_alive

bool octave::jit_block::m_alive
private

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

◆ m_df

df_set octave::jit_block::m_df
private

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

Referenced by compute_df().

◆ m_dom_succ

std::vector<jit_block *> octave::jit_block::m_dom_succ
private

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

Referenced by create_dom_tree(), and print_dom().

◆ m_id

size_t octave::jit_block::m_id
private

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

Referenced by label(), and print_dom().

◆ m_idom

jit_block* octave::jit_block::m_idom
private

◆ m_in_worklist

bool octave::jit_value::m_in_worklist
privateinherited

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

◆ m_instructions

instruction_list octave::jit_block::m_instructions
private

◆ m_last_use

jit_instruction* octave::jit_value::m_last_use
privateinherited

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

◆ m_llvm_value

llvm::Value* octave::jit_value::m_llvm_value
protectedinherited

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

Referenced by to_llvm().

◆ m_location

std::list<jit_block *>::iterator octave::jit_block::m_location
private

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

◆ m_name

std::string octave::jit_block::m_name
private

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

◆ m_type

jit_type* octave::jit_value::m_type
privateinherited

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

◆ m_use_count

size_t octave::jit_internal_list< jit_value , jit_use >::m_use_count
privateinherited

Definition at line 153 of file jit-util.h.

◆ m_use_head

jit_use * octave::jit_internal_list< jit_value , jit_use >::m_use_head
privateinherited

Definition at line 151 of file jit-util.h.

◆ m_use_tail

jit_use * octave::jit_internal_list< jit_value , jit_use >::m_use_tail
privateinherited

Definition at line 152 of file jit-util.h.

◆ m_visit_count

size_t octave::jit_block::m_visit_count
private

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

Referenced by maybe_split().

◆ NO_ID

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

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

Referenced by octave::jit_infer::place_releases().


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