Halide 21.0.0
Halide compiler and libraries
|
An IRVisitor that emits IR to the given output stream in a human readable form. More...
#include <IRPrinter.h>
Public Member Functions | |
IRPrinter (std::ostream &) | |
Construct an IRPrinter pointed at a given output stream (e.g. | |
void | print (const Expr &) |
emit an expression on the output stream | |
void | print_no_parens (const Expr &) |
Emit an expression on the output stream without enclosing parens. | |
void | print (const Stmt &) |
emit a statement on the output stream | |
void | print_summary (const Stmt &) |
emit a statement summary on the output stream | |
void | print_list (const std::vector< Expr > &exprs) |
emit a comma delimited list of exprs, without any leading or trailing punctuation. | |
Public Member Functions inherited from Halide::Internal::IRVisitor | |
IRVisitor ()=default | |
virtual | ~IRVisitor ()=default |
Static Public Member Functions | |
static void | test () |
Protected Member Functions | |
Indentation | get_indent () const |
template<typename T> | |
Ansi< T > | hl (const T &t) |
template<typename T> | |
Ansi< T > | kw (const T &t) |
template<typename T> | |
Ansi< T > | imm_int (const T &t) |
template<typename T> | |
Ansi< T > | imm_float (const T &t) |
template<typename T> | |
Ansi< T > | imm_str (const T &t) |
template<typename T> | |
Ansi< T > | var (const T &t) |
template<typename T> | |
Ansi< T > | buf (const T &t) |
template<typename T> | |
Ansi< T > | fn (const T &t) |
template<typename T> | |
Ansi< T > | type (const T &t) |
template<typename T> | |
Ansi< T > | typep (const T &t) |
template<typename T> | |
Ansi< T > | paren (const T &t, bool bold=true, int d=-1) |
void | open () |
Either emits "(" or "", depending on the value of implicit_parens. | |
void | close () |
Either emits ")" or "", depending on the value of implicit_parens. | |
void | openf () |
Emits "(" always. | |
void | openf (const char *name) |
Emits "name(" always. | |
void | closef () |
Emits ")" always. | |
void | print_lets (const Let *let) |
A helper for printing a chain of lets with line breaks. | |
void | print_braced_stmt (const Stmt &, int extra_indent=2) |
A helper for printing a braced statement. | |
void | visit (const IntImm *) override |
void | visit (const UIntImm *) override |
void | visit (const FloatImm *) override |
void | visit (const StringImm *) override |
void | visit (const Cast *) override |
void | visit (const Reinterpret *) override |
void | visit (const Variable *) override |
void | visit (const Add *) override |
void | visit (const Sub *) override |
void | visit (const Mul *) override |
void | visit (const Div *) override |
void | visit (const Mod *) override |
void | visit (const Min *) override |
void | visit (const Max *) override |
void | visit (const EQ *) override |
void | visit (const NE *) override |
void | visit (const LT *) override |
void | visit (const LE *) override |
void | visit (const GT *) override |
void | visit (const GE *) override |
void | visit (const And *) override |
void | visit (const Or *) override |
void | visit (const Not *) override |
void | visit (const Select *) override |
void | visit (const Load *) override |
void | visit (const Ramp *) override |
void | visit (const Broadcast *) override |
void | visit (const Call *) override |
void | visit (const Let *) override |
void | visit (const LetStmt *) override |
void | visit (const AssertStmt *) override |
void | visit (const ProducerConsumer *) override |
void | visit (const For *) override |
void | visit (const Acquire *) override |
void | visit (const Store *) override |
void | visit (const Provide *) override |
void | visit (const Allocate *) override |
void | visit (const Free *) override |
void | visit (const Realize *) override |
void | visit (const Block *) override |
void | visit (const Fork *) override |
void | visit (const IfThenElse *) override |
void | visit (const Evaluate *) override |
void | visit (const Shuffle *) override |
void | visit (const VectorReduce *) override |
void | visit (const Prefetch *) override |
void | visit (const Atomic *) override |
void | visit (const HoistedStorage *) override |
Protected Attributes | |
std::ostream & | stream |
The stream on which we're outputting. | |
int | indent = 0 |
The current indentation level, useful for pretty-printing statements. | |
bool | implicit_parens = false |
Certain expressions do not need parens around them, e.g. | |
bool | is_summary = false |
Print only a summary of a statement, with sub-statements replaced by ellipses (...). | |
bool | ansi = false |
int | paren_depth = 0 |
const char * | ansi_hl = "" |
const char * | ansi_dim = "" |
const char * | ansi_kw = "" |
const char * | ansi_imm_int = "" |
const char * | ansi_imm_float = "" |
const char * | ansi_imm_str = "" |
const char * | ansi_var = "" |
const char * | ansi_buf = "" |
const char * | ansi_fn = "" |
const char * | ansi_type = "" |
const char * | ansi_reset_col = "" |
const char * | ansi_reset = "" |
Scope | known_type |
The symbols whose types can be inferred from values printed already. |
An IRVisitor that emits IR to the given output stream in a human readable form.
Can be subclassed if you want to modify the way in which it prints.
Definition at line 140 of file IRPrinter.h.
|
explicit |
Construct an IRPrinter pointed at a given output stream (e.g.
std::cout, or a std::ofstream)
void Halide::Internal::IRPrinter::print | ( | const Expr & | ) |
emit an expression on the output stream
void Halide::Internal::IRPrinter::print_no_parens | ( | const Expr & | ) |
Emit an expression on the output stream without enclosing parens.
void Halide::Internal::IRPrinter::print | ( | const Stmt & | ) |
emit a statement on the output stream
void Halide::Internal::IRPrinter::print_summary | ( | const Stmt & | ) |
emit a statement summary on the output stream
void Halide::Internal::IRPrinter::print_list | ( | const std::vector< Expr > & | exprs | ) |
emit a comma delimited list of exprs, without any leading or trailing punctuation.
|
static |
|
inlineprotected |
Definition at line 165 of file IRPrinter.h.
References indent.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Either emits "(" or "", depending on the value of implicit_parens.
|
protected |
Either emits ")" or "", depending on the value of implicit_parens.
|
protected |
Emits "(" always.
|
protected |
Emits "name(" always.
|
protected |
Emits ")" always.
|
protected |
A helper for printing a chain of lets with line breaks.
|
protected |
A helper for printing a braced statement.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
Referenced by Halide::Internal::CodeGen_C::set_name_mangling_mode().
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
overrideprotectedvirtual |
Reimplemented from Halide::Internal::IRVisitor.
|
protected |
The stream on which we're outputting.
Definition at line 170 of file IRPrinter.h.
|
protected |
The current indentation level, useful for pretty-printing statements.
Definition at line 174 of file IRPrinter.h.
Referenced by get_indent().
|
protected |
Certain expressions do not need parens around them, e.g.
the args to a call are already separated by commas and a surrounding set of parens.
Definition at line 179 of file IRPrinter.h.
|
protected |
Print only a summary of a statement, with sub-statements replaced by ellipses (...).
Definition at line 183 of file IRPrinter.h.
|
protected |
Definition at line 185 of file IRPrinter.h.
|
protected |
Definition at line 186 of file IRPrinter.h.
|
protected |
Definition at line 188 of file IRPrinter.h.
|
protected |
Definition at line 189 of file IRPrinter.h.
|
protected |
Definition at line 190 of file IRPrinter.h.
|
protected |
Definition at line 191 of file IRPrinter.h.
|
protected |
Definition at line 192 of file IRPrinter.h.
|
protected |
Definition at line 193 of file IRPrinter.h.
|
protected |
Definition at line 194 of file IRPrinter.h.
|
protected |
Definition at line 195 of file IRPrinter.h.
|
protected |
Definition at line 196 of file IRPrinter.h.
|
protected |
Definition at line 197 of file IRPrinter.h.
|
protected |
Definition at line 198 of file IRPrinter.h.
|
protected |
Definition at line 199 of file IRPrinter.h.
|
protected |
The symbols whose types can be inferred from values printed already.
Definition at line 232 of file IRPrinter.h.