GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "jit-ir.h"
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 |
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_block * | idom_intersect (jit_block *i, jit_block *j) |
Private Attributes | |
std::vector< jit_block * > | dom_succ |
jit_block * | idom |
instruction_list | instructions |
bool | malive |
df_set | mdf |
size_t | mid |
std::list< jit_block * >::iterator | mlocation |
std::string | mname |
size_t | mvisit_count |
typedef instruction_list::const_iterator jit_block::const_iterator |
typedef df_set::const_iterator jit_block::df_iterator |
typedef std::set<jit_block *> jit_block::df_set |
|
private |
typedef std::list<jit_instruction *> jit_block::instruction_list |
typedef instruction_list::iterator jit_block::iterator |
|
inline |
|
virtual |
Definition at line 575 of file jit-ir.h.
References jit_terminator::malive.
Referenced by jit_phi::infer(), maybe_split(), and jit_infer::remove_dead().
|
inline |
Definition at line 592 of file jit-ir.h.
Referenced by jit_convert::create_checked_impl(), jit_convert::do_assign(), jit_convert::finish_breaks(), jit_convert::jit_convert(), maybe_split(), prepend_after_phi(), jit_infer::remove_dead(), jit_convert::visit_binary_expression(), jit_convert::visit_colon_expression(), jit_convert::visit_identifier(), jit_convert::visit_if_command_list(), jit_convert::visit_simple_for_command(), jit_convert::visit_statement(), and jit_convert::visit_while_command().
|
inline |
Definition at line 748 of file jit-ir.h.
Referenced by jit_block_list::back(), and jit_convert_llvm::convert_function().
Definition at line 629 of file jit-ir.h.
Referenced by jit_infer::append_users_term(), jit_convert_llvm::convert(), jit_convert_llvm::convert_loop(), jit_infer::do_construct_ssa(), merge(), pop_all(), prepend_after_phi(), print(), jit_infer::release_dead_phi(), jit_infer::release_temp(), jit_infer::remove_dead(), jit_infer::simplify_phi(), and jit_convert_llvm::visit().
|
inline |
Definition at line 372 of file jit-ir.cc.
References jit_terminator::alive(), and terminator().
Referenced by jit_phi::infer(), and jit_phi::prune().
Definition at line 675 of file jit-ir.h.
Referenced by compute_df(), and jit_infer::construct_ssa().
Definition at line 432 of file jit-ir.cc.
References compute_df(), first_use(), idom, mdf, jit_internal_node< LIST_T, NODE_T >::next(), successor(), successor_count(), use_count(), and visited().
Definition at line 680 of file jit-ir.h.
Referenced by jit_infer::construct_ssa(), and create_dom_tree().
Definition at line 565 of file jit-ir.cc.
References create_dom_tree(), dom_succ, idom, successor(), successor_count(), and visited().
|
inline |
Definition at line 649 of file jit-ir.h.
Referenced by jit_infer::construct_ssa(), and print_dom().
|
inline |
Definition at line 651 of file jit-ir.h.
Referenced by jit_infer::construct_ssa(), and print_dom().
Definition at line 685 of file jit-ir.h.
Referenced by jit_infer::do_construct_ssa().
Definition at line 690 of file jit-ir.h.
Referenced by jit_infer::do_construct_ssa().
Definition at line 633 of file jit-ir.h.
Referenced by jit_infer::append_users_term(), jit_convert_llvm::convert(), jit_convert_llvm::convert_loop(), jit_infer::do_construct_ssa(), merge(), pop_all(), prepend_after_phi(), print(), jit_infer::release_dead_phi(), jit_infer::release_temp(), jit_infer::remove_dead(), jit_infer::simplify_phi(), and jit_convert_llvm::visit().
|
inline |
Reimplemented from jit_internal_list< jit_block, jit_phi_incomming >.
Definition at line 570 of file jit-ir.h.
References jit_internal_list< jit_value, jit_use >::first_use().
Referenced by compute_df(), label(), print(), print_dom(), and update_idom().
Definition at line 153 of file jit-ir.cc.
References jit_internal_list< jit_value, jit_use >::first_use(), jit_internal_node< LIST_T, NODE_T >::next(), jit_use::user(), and jit_use::user_parent().
Referenced by jit_infer::release_temp().
|
inline |
Definition at line 746 of file jit-ir.h.
Referenced by jit_block_list::front().
Definition at line 250 of file jit-ir.h.
References jit_value::llvm_value.
Definition at line 644 of file jit-ir.h.
References jit_instruction::mid.
Referenced by idom_intersect(), and jit_infer::place_releases().
Definition at line 196 of file jit-ir.h.
References jit_value::min_worklist.
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().
|
inline |
Definition at line 607 of file jit-ir.h.
References jit_instruction::location().
jit_instruction * jit_block::insert_before | ( | iterator | loc, |
jit_instruction * | instr | ||
) |
Definition at line 344 of file jit-ir.cc.
References instructions, and jit_instruction::stash_parent().
Referenced by prepend_after_phi(), jit_infer::release_dead_phi(), jit_infer::release_temp(), and jit_infer::simplify_phi().
|
inline |
Definition at line 600 of file jit-ir.h.
References jit_instruction::location().
|
private |
Definition at line 337 of file jit-ir.cc.
References instructions, and jit_instruction::stash_parent().
Definition at line 654 of file jit-ir.h.
Referenced by jit_block_list::label(), and label().
Definition at line 489 of file jit-ir.cc.
References first_use(), label(), mid, jit_internal_node< LIST_T, NODE_T >::next(), and visited().
|
inlineinherited |
Reimplemented in jit_variable.
Definition at line 234 of file jit-ir.h.
References jit_value::mlast_use.
Definition at line 724 of file jit-ir.h.
References jit_instruction::mlocation.
Referenced by jit_block_list::insert_after(), and jit_block_list::insert_before().
Definition at line 577 of file jit-ir.h.
References jit_terminator::malive.
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 | ||
) |
Definition at line 536 of file jit-ir.cc.
References alive(), append(), jit_factory::create(), jit_terminator::infer(), jit_block_list::insert_after(), mark_alive(), mvisit_count, replace_in_phi(), jit_instruction::stash_argument(), successor_count(), jit_terminator::successor_index(), and terminator().
Referenced by jit_infer::release_dead_phi(), jit_infer::release_temp(), and jit_infer::simplify_phi().
|
inline |
Definition at line 282 of file jit-ir.cc.
References begin(), end(), instructions, jit_instruction::remove(), replace_with(), jit_instruction::stash_parent(), and terminator().
Referenced by maybe_merge().
|
inline |
Definition at line 585 of file jit-ir.h.
Referenced by jit_convert_llvm::convert(), jit_convert::create_checked_impl(), and jit_convert::visit_binary_expression().
Reimplemented in jit_call.
Definition at line 241 of file jit-ir.h.
Referenced by jit_infer::release_dead_phi(), and jit_infer::release_temp().
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 | ) |
Definition at line 312 of file jit-ir.cc.
References instructions, and jit_instruction::stash_parent().
Referenced by jit_infer::construct_ssa(), and jit_convert::create_variable().
jit_instruction * jit_block::prepend_after_phi | ( | jit_instruction * | instr | ) |
|
virtual |
Implements jit_value.
Definition at line 514 of file jit-ir.cc.
References begin(), end(), first_use(), jit_internal_node< LIST_T, NODE_T >::next(), jit_value::print(), jit_value::print_indent(), and short_print().
std::ostream & jit_block::print_dom | ( | std::ostream & | os | ) | const |
Definition at line 398 of file jit-ir.cc.
References df_begin(), df_end(), dom_succ, first_use(), idom, mid, jit_internal_node< LIST_T, NODE_T >::next(), short_print(), successor(), and successor_count().
|
inlineprotectedinherited |
Definition at line 267 of file jit-ir.h.
Referenced by jit_argument::print(), jit_const< T, EXTRACT_T, PASS_T, QUOTE >::print(), print(), jit_variable::print(), jit_assign::print(), jit_phi::print(), jit_branch::print(), jit_cond_branch::print(), jit_call::print(), jit_error_check::print(), jit_magic_end::print(), jit_extract_argument::print(), jit_store_argument::print(), and jit_return::print().
|
inlineinherited |
Definition at line 227 of file jit-ir.h.
References jit_value::print().
Definition at line 612 of file jit-ir.h.
References jit_instruction::stash_parent().
Referenced by jit_instruction::remove(), and jit_infer::remove_dead().
Definition at line 254 of file jit-ir.cc.
References jit_internal_list< jit_block, jit_phi_incomming >::first_use(), jit_internal_node< LIST_T, NODE_T >::next(), jit_internal_node< LIST_T, NODE_T >::stash_value(), and jit_phi_incomming::user_parent().
Referenced by maybe_split().
Reimplemented from jit_value.
Definition at line 239 of file jit-ir.cc.
References jit_internal_list< jit_block, jit_phi_incomming >::first_use(), and jit_internal_node< LIST_T, NODE_T >::stash_value().
Referenced by merge().
|
inlinevirtual |
Reimplemented from jit_value.
Definition at line 712 of file jit-ir.h.
References jit_instruction::mid.
Referenced by print(), print_dom(), and jit_terminator::print_successor().
Definition at line 201 of file jit-ir.h.
References jit_value::min_worklist.
Referenced by jit_infer::infer(), and jit_infer::push_worklist().
|
inlineinherited |
Reimplemented in jit_variable.
Definition at line 236 of file jit-ir.h.
References jit_value::mlast_use.
|
inlineinherited |
Definition at line 261 of file jit-ir.h.
References jit_value::llvm_value.
Referenced by jit_convert_llvm::convert(), jit_argument::jit_argument(), and jit_convert_llvm::visit().
Definition at line 727 of file jit-ir.h.
References jit_instruction::mlocation.
Referenced by jit_block_list::insert_before(), and jit_block_list::push_back().
Definition at line 225 of file jit-ir.h.
References jit_value::ty.
Referenced by jit_assign::infer(), jit_phi::infer(), jit_call::infer(), jit_magic_end::infer(), jit_argument::jit_argument(), jit_call::jit_call(), jit_const< T, EXTRACT_T, PASS_T, QUOTE >::jit_const(), and jit_extract_argument::jit_extract_argument().
Definition at line 378 of file jit-ir.cc.
References jit_terminator::successor(), and terminator().
Referenced by compute_df(), create_dom_tree(), jit_infer::do_construct_ssa(), maybe_merge(), and print_dom().
Definition at line 385 of file jit-ir.cc.
References jit_terminator::successor_count(), and terminator().
Referenced by compute_df(), create_dom_tree(), jit_infer::do_construct_ssa(), maybe_merge(), maybe_split(), and print_dom().
jit_terminator * jit_block::terminator | ( | void | ) | const |
Definition at line 361 of file jit-ir.cc.
References instructions.
Referenced by jit_infer::append_users_term(), branch_alive(), jit_infer::infer(), maybe_split(), merge(), jit_infer::release_dead_phi(), jit_infer::release_temp(), jit_infer::remove_dead(), jit_infer::simplify_phi(), successor(), and successor_count().
llvm::BasicBlock * jit_block::to_llvm | ( | void | ) | const |
Reimplemented from jit_value.
Definition at line 392 of file jit-ir.cc.
References jit_value::llvm_value.
Referenced by jit_convert_llvm::convert(), jit_instruction::parent_llvm(), jit_terminator::successor_llvm(), and jit_convert_llvm::visit().
Definition at line 213 of file jit-ir.h.
References jit_value::ty.
Referenced by jit_instruction::argument_type(), jit_typeinfo::do_end(), jit_phi::infer(), jit_call::infer(), jit_magic_end::infer(), jit_call::needs_release(), jit_return::result_type(), jit_instruction::short_print(), jit_infer::simplify_phi(), jit_factory::track_value(), and jit_convert_llvm::visit().
|
inlineinherited |
Definition at line 215 of file jit-ir.h.
References jit_type::to_llvm(), and jit_value::ty.
Referenced by jit_convert_llvm::visit().
|
inlineinherited |
Definition at line 220 of file jit-ir.h.
References jit_type::name(), and jit_value::ty.
Definition at line 455 of file jit-ir.cc.
References first_use(), idom, idom_intersect(), jit_internal_node< LIST_T, NODE_T >::next(), update_idom(), use_count(), jit_use::user_parent(), and visited().
Referenced by update_idom().
Reimplemented from jit_internal_list< jit_block, jit_phi_incomming >.
Definition at line 572 of file jit-ir.h.
References jit_internal_list< jit_value, jit_use >::use_count().
Referenced by compute_df(), jit_infer::construct_ssa(), maybe_merge(), and update_idom().
Definition at line 735 of file jit-ir.h.
Referenced by compute_df(), create_dom_tree(), jit_infer::do_construct_ssa(), label(), and update_idom().
|
private |
Definition at line 766 of file jit-ir.h.
Referenced by create_dom_tree(), and print_dom().
|
private |
Definition at line 764 of file jit-ir.h.
Referenced by compute_df(), compute_idom(), create_dom_tree(), idom_intersect(), print_dom(), and update_idom().
|
private |
Definition at line 768 of file jit-ir.h.
Referenced by insert_after(), insert_before(), internal_append(), maybe_merge(), merge(), prepend(), and terminator().
|
protectedinherited |
Definition at line 274 of file jit-ir.h.
Referenced by jit_value::has_llvm(), jit_value::stash_llvm(), jit_value::to_llvm(), and to_llvm().
|
private |
Definition at line 765 of file jit-ir.h.
Referenced by compute_df().
|
private |
Definition at line 763 of file jit-ir.h.
Referenced by label(), and print_dom().
|
private |
Definition at line 762 of file jit-ir.h.
Referenced by maybe_split().
Definition at line 558 of file jit-ir.h.
Referenced by jit_infer::place_releases().