1#ifndef HALIDE_IR_PRINTER_H
2#define HALIDE_IR_PRINTER_H
27std::ostream &
operator<<(std::ostream &stream,
const Expr &);
31std::ostream &
operator<<(std::ostream &stream,
const Type &);
35std::ostream &
operator<<(std::ostream &stream,
const Module &);
58struct AssociativePattern;
62struct ConstantInterval;
63struct ModulusRemainder;
Defines the base class for things that recursively walk over the IR.
Defines Module, an IR container that fully describes a Halide program.
Defines the Scope class, which is used for keeping track of names in a scope while traversing IR.
A helper class to manage closures.
An IRVisitor that emits IR to the given output stream in a human readable form.
void visit(const EQ *) override
void visit(const Sub *) override
void visit(const Provide *) override
void visit(const And *) override
Scope known_type
The symbols whose types can be inferred from values printed already.
void visit(const GE *) override
void visit(const Div *) override
void visit(const Free *) override
void visit(const Or *) override
int indent
The current indentation level, useful for pretty-printing statements.
void print(const Expr &)
emit an expression on the output stream
void visit(const Load *) override
void visit(const UIntImm *) override
void print_no_parens(const Expr &)
Emit an expression on the output stream without enclosing parens.
void print_lets(const Let *let)
A helper for printing a chain of lets with line breaks.
void visit(const Variable *) override
void visit(const Max *) override
void visit(const Block *) override
void visit(const Reinterpret *) override
void visit(const Add *) override
void visit(const Ramp *) override
void print_list(const std::vector< Expr > &exprs)
emit a comma delimited list of exprs, without any leading or trailing punctuation.
void visit(const Acquire *) override
void visit(const AssertStmt *) override
Indentation get_indent() const
void visit(const Mul *) override
void visit(const Prefetch *) override
void visit(const Atomic *) override
bool implicit_parens
Certain expressions do not need parens around them, e.g.
void visit(const Cast *) override
void visit(const VectorReduce *) override
void visit(const LetStmt *) override
void visit(const StringImm *) override
void visit(const Realize *) override
void visit(const LE *) override
void visit(const Broadcast *) override
void visit(const Evaluate *) override
std::ostream & stream
The stream on which we're outputting.
void visit(const Select *) override
void visit(const FloatImm *) override
void visit(const IntImm *) override
IRPrinter(std::ostream &)
Construct an IRPrinter pointed at a given output stream (e.g.
void visit(const LT *) override
void visit(const For *) override
void visit(const Store *) override
void visit(const Mod *) override
void close()
Either emits ")" or "", depending on the value of implicit_parens.
void visit(const ProducerConsumer *) override
void visit(const HoistedStorage *) override
void visit(const Shuffle *) override
void visit(const Not *) override
void visit(const GT *) override
void visit(const NE *) override
void print(const Stmt &)
emit a statement on the output stream
void visit(const Min *) override
void open()
Either emits "(" or "", depending on the value of implicit_parens.
void visit(const IfThenElse *) override
void visit(const Call *) override
void visit(const Fork *) override
void visit(const Allocate *) override
void visit(const Let *) override
A base class for algorithms that need to recursively walk over the IR.
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Le...
A reference to a site in a Halide statement at the top of the body of a particular for loop.
DimType
Each Dim below has a dim_type, which tells you what transformations are legal on it.
ForType
An enum describing a type of loop traversal.
ConstantInterval operator<<(const ConstantInterval &a, const ConstantInterval &b)
IRNodeType
All our IR node types get unique IDs for the purposes of RTTI.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
LinkageType
Type of linkage a function in a lowered Halide module can have.
@ Internal
Not visible externally, similar to 'static' linkage in C.
TailStrategy
Different ways to handle a tail case in a split when the factor does not provably divide the extent.
std::ostream & operator<<(std::ostream &stream, const Expr &)
Emit an expression on an output stream (such as std::cout) in human-readable form.
NameMangling
An enum to specify calling convention for extern stages.
DeviceAPI
An enum describing a type of device API.
MemoryType
An enum describing different address spaces to be used with Func::store_in.
Partition
Different ways to handle loops with a potentially optimizable boundary conditions.
A fragment of Halide syntax.
The sum of two expressions.
Allocate a scratch area called with the given name, type, and size.
Logical and - are both expressions true.
If the 'condition' is false, then evaluate and return the message, which should be a call to an error...
Represent the equivalent associative op of an update definition.
Represent an associative op with its identity.
Lock all the Store nodes in the body statement.
A sequence of statements to be executed in-order.
A vector with 'lanes' elements, in which every element is 'value'.
The actual IR nodes begin here.
A class to represent ranges of integers.
The ratio of two expressions.
Is the first expression equal to the second.
Evaluate and discard an expression, presumably because it has some side-effect.
Floating point constants.
A pair of statements executed concurrently.
Free the resources associated with the given buffer.
Is the first expression greater than or equal to the second.
Is the first expression greater than the second.
Represents a location where storage will be hoisted to for a Func / Realize node with a given name.
A class to represent ranges of Exprs.
Is the first expression less than or equal to the second.
Is the first expression less than the second.
A let expression, like you might find in a functional language.
The statement form of a let node.
Load a value from a named symbol if predicate is true.
Definition of a lowered function.
The greater of two values.
The lesser of two values.
The result of modulus_remainder analysis.
The product of two expressions.
Is the first expression not equal to the second.
Logical not - true if the expression false.
Logical or - is at least one of the expression true.
Represent a multi-dimensional region of a Func or an ImageParam that needs to be prefetched.
This node is a helpful annotation to do with permissions.
This defines the value of a function at a multi-dimensional location.
A linear ramp vector node.
Allocate a multi-dimensional buffer of the given type and size.
Reinterpret value as another type, without affecting any of the bits (on little-endian systems).
Construct a new vector by taking elements from another sequence of vectors.
A reference-counted handle to a statement node.
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
The difference of two expressions.
Unsigned integer constants.
Horizontally reduce a vector to a scalar or narrower vector using the given commutative and associati...
A struct representing a target machine and os to generate code for.