GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::jit_instruction Class Referenceabstract

#include "jit-ir.h"

Inheritance diagram for octave::jit_instruction:
Collaboration diagram for octave::jit_instruction:

Public Member Functions

 jit_instruction (void)
 
 jit_instruction (size_t nargs)
 
template<typename ... Args>
 jit_instruction (jit_value *arg1, Args... other_args)
 
 jit_instruction (const std::vector< jit_value *> &aarguments)
 
virtual void accept (jit_ir_walker &walker)=0
 
jit_valueargument (size_t i) const
 
size_t argument_count (void) const
 
llvm::Value * argument_llvm (size_t i) const
 
jit_typeargument_type (size_t i) const
 
llvm::Type * argument_type_llvm (size_t i) const
 
const std::vector< jit_type * > & argument_types (void) const
 
const std::vector< jit_use > & arguments (void) const
 
virtual void construct_ssa (void)
 
jit_usefirst_use (void) const
 
jit_blockfirst_use_block (void)
 
bool has_llvm (void) const
 
size_t id (void) const
 
bool in_worklist (void) const
 
virtual bool infer (void)
 
jit_instructionlast_use (void) const
 
std::list< jit_instruction * >::iterator location (void) const
 
virtual bool needs_release (void) const
 
jit_blockparent (void) const
 
llvm::BasicBlock * parent_llvm (void) const
 
virtual void pop_variable (void)
 
virtual std::ostream & print (std::ostream &os, size_t indent=0) const =0
 
std::ostream & print_argument (std::ostream &os, size_t i) const
 
std::string print_string (void)
 
void push_argument (jit_value *arg)
 
virtual void push_variable (void)
 
void remove (void)
 
virtual void replace_with (jit_value *m_value)
 
void resize_arguments (size_t acount, jit_value *adefault=nullptr)
 
virtual std::ostream & short_print (std::ostream &os) const
 
void stash_argument (size_t i, jit_value *arg)
 
template<typename ... Args>
void stash_argument (size_t i, jit_value *arg1, Args... aargs)
 
void stash_in_worklist (bool ain_worklist)
 
void stash_last_use (jit_instruction *alast_use)
 
void stash_llvm (llvm::Value *compiled)
 
void stash_parent (jit_block *aparent, std::list< jit_instruction *>::iterator alocation)
 
void stash_type (jit_type *new_type)
 
llvm::Value * to_llvm (void) const
 
jit_typetype (void) const
 
llvm::Type * type_llvm (void) const
 
const std::stringtype_name (void) const
 
size_t use_count (void) const
 

Static Public Member Functions

static void reset_ids (void)
 

Protected Member Functions

void do_construct_ssa (size_t start, size_t end)
 
std::ostream & print_indent (std::ostream &os, size_t indent=0) const
 

Protected Attributes

std::vector< jit_type * > m_already_infered
 
llvm::Value * m_llvm_value
 

Static Private Member Functions

static size_t next_id (bool reset=false)
 

Private Attributes

std::vector< jit_usem_arguments
 
size_t m_id
 
std::list< jit_instruction * >::iterator m_location
 
jit_blockm_parent
 

Detailed Description

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

Constructor & Destructor Documentation

◆ jit_instruction() [1/4]

octave::jit_instruction::jit_instruction ( void  )
inline

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

◆ jit_instruction() [2/4]

octave::jit_instruction::jit_instruction ( size_t  nargs)
inline

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

◆ jit_instruction() [3/4]

template<typename ... Args>
octave::jit_instruction::jit_instruction ( jit_value arg1,
Args...  other_args 
)
inline

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

◆ jit_instruction() [4/4]

octave::jit_instruction::jit_instruction ( const std::vector< jit_value *> &  aarguments)
inline

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

References i.

Member Function Documentation

◆ accept()

◆ argument()

◆ argument_count()

◆ argument_llvm()

llvm::Value* octave::jit_instruction::argument_llvm ( size_t  i) const
inline

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

References argument, and i.

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

◆ argument_type()

jit_type* octave::jit_instruction::argument_type ( size_t  i) const
inline

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

References argument, and i.

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

◆ argument_type_llvm()

llvm::Type* octave::jit_instruction::argument_type_llvm ( size_t  i) const
inline

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

References argument, and i.

◆ argument_types()

const std::vector<jit_type *>& octave::jit_instruction::argument_types ( void  ) const
inline

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

◆ arguments()

const std::vector<jit_use>& octave::jit_instruction::arguments ( void  ) const
inline

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

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

◆ construct_ssa()

virtual void octave::jit_instruction::construct_ssa ( void  )
inlinevirtual

Reimplemented in octave::jit_phi.

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

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

◆ do_construct_ssa()

void octave::jit_instruction::do_construct_ssa ( size_t  start,
size_t  end 
)
protected

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

References arg, argument(), i, start, stash_argument(), and var.

◆ first_use()

◆ first_use_block()

◆ has_llvm()

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

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

◆ id()

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

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

◆ in_worklist()

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

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

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

◆ infer()

virtual bool octave::jit_instruction::infer ( void  )
inlinevirtual

◆ last_use()

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

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

◆ location()

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

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

◆ needs_release()

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

Reimplemented in octave::jit_call.

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

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

◆ next_id()

static size_t octave::jit_instruction::next_id ( bool  reset = false)
inlinestaticprivate

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

◆ parent()

◆ parent_llvm()

llvm::BasicBlock * octave::jit_instruction::parent_llvm ( void  ) const

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

References m_parent, and octave::jit_block::to_llvm().

◆ pop_variable()

virtual void octave::jit_instruction::pop_variable ( void  )
inlinevirtual

Reimplemented in octave::jit_assign_base.

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

Referenced by octave::jit_block::pop_all().

◆ print()

◆ print_argument()

std::ostream& octave::jit_instruction::print_argument ( std::ostream &  os,
size_t  i 
) const
inline

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

References argument, i, and os.

◆ print_indent()

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

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

References i, and os.

Referenced by octave::jit_block::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 223 of file jit-ir.h.

◆ push_argument()

void octave::jit_instruction::push_argument ( jit_value arg)
inline

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

References arg.

◆ push_variable()

virtual void octave::jit_instruction::push_variable ( void  )
inlinevirtual

Reimplemented in octave::jit_assign_base.

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

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

◆ remove()

◆ replace_with()

◆ reset_ids()

static void octave::jit_instruction::reset_ids ( void  )
inlinestatic

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

Referenced by octave::jit_convert::initialize().

◆ resize_arguments()

void octave::jit_instruction::resize_arguments ( size_t  acount,
jit_value adefault = nullptr 
)
inline

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

References i.

Referenced by octave::jit_magic_end::jit_magic_end(), octave::jit_phi::prune(), and remove().

◆ short_print()

std::ostream & octave::jit_instruction::short_print ( std::ostream &  os) const
virtual

Reimplemented from octave::jit_value.

Reimplemented in octave::jit_magic_end, and octave::jit_assign_base.

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

References octave::jit_print(), m_id, os, and octave::jit_value::type().

◆ stash_argument() [1/2]

void octave::jit_instruction::stash_argument ( size_t  i,
jit_value arg 
)
inline

◆ stash_argument() [2/2]

template<typename ... Args>
void octave::jit_instruction::stash_argument ( size_t  i,
jit_value arg1,
Args...  aargs 
)
inline

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

References i.

◆ stash_in_worklist()

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

Definition at line 197 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 232 of file jit-ir.h.

◆ stash_llvm()

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

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

References compiled.

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

◆ stash_parent()

void octave::jit_instruction::stash_parent ( jit_block aparent,
std::list< jit_instruction *>::iterator  alocation 
)
inline

◆ stash_type()

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

◆ to_llvm()

llvm::Value* octave::jit_value::to_llvm ( void  ) const
inlineinherited

◆ type()

◆ type_llvm()

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

Definition at line 211 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 216 of file jit-ir.h.

◆ use_count()

size_t octave::jit_internal_list< jit_value , jit_use >::use_count ( void  ) const
inlineinherited

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

Referenced by octave::jit_call::infer(), and octave::jit_block::use_count().

Member Data Documentation

◆ m_already_infered

std::vector<jit_type *> octave::jit_instruction::m_already_infered
protected

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

Referenced by octave::jit_call::infer().

◆ m_arguments

std::vector<jit_use> octave::jit_instruction::m_arguments
private

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

◆ m_id

size_t octave::jit_instruction::m_id
private

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

Referenced by short_print().

◆ m_llvm_value

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

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

Referenced by octave::jit_block::to_llvm().

◆ m_location

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

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

Referenced by remove().

◆ m_parent

jit_block* octave::jit_instruction::m_parent
private

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

Referenced by parent_llvm(), and remove().


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