Halide 18.0.0
Halide compiler and libraries
|
A function call. More...
#include <IR.h>
Public Member Functions | |
bool | is_pure () const |
Check if a call node is pure within a pipeline, meaning that the same args always give the same result, and the calls can be reordered, duplicated, unified, etc without changing the meaning of anything. | |
bool | is_intrinsic () const |
bool | is_intrinsic (IntrinsicOp op) const |
bool | is_intrinsic (std::initializer_list< IntrinsicOp > intrinsics) const |
bool | is_tag () const |
bool | is_extern () const |
![]() | |
void | accept (IRVisitor *v) const override |
We use the visitor pattern to traverse IR nodes throughout the compiler, so we have a virtual accept method which accepts visitors. | |
Expr | mutate_expr (IRMutator *v) const override |
ExprNode () | |
~ExprNode () override=default | |
![]() | |
BaseExprNode (IRNodeType t) | |
![]() | |
IRNode (IRNodeType t) | |
virtual | ~IRNode ()=default |
Static Public Member Functions | |
static const char * | get_intrinsic_name (IntrinsicOp op) |
static Expr | make (Type type, IntrinsicOp op, const std::vector< Expr > &args, CallType call_type, FunctionPtr func=FunctionPtr(), int value_index=0, const Buffer<> &image=Buffer<>(), Parameter param=Parameter()) |
static Expr | make (Type type, const std::string &name, const std::vector< Expr > &args, CallType call_type, FunctionPtr func=FunctionPtr(), int value_index=0, Buffer<> image=Buffer<>(), Parameter param=Parameter()) |
static Expr | make (const Function &func, const std::vector< Expr > &args, int idx=0) |
Convenience constructor for calls to other halide functions. | |
static Expr | make (const Buffer<> &image, const std::vector< Expr > &args) |
Convenience constructor for loads from concrete images. | |
static Expr | make (const Parameter ¶m, const std::vector< Expr > &args) |
Convenience constructor for loads from images parameters. | |
static const Call * | as_intrinsic (const Expr &e, std::initializer_list< IntrinsicOp > intrinsics) |
Returns a pointer to a call node if the expression is a call to one of the requested intrinsics. | |
static const Call * | as_tag (const Expr &e) |
Public Attributes | |
std::string | name |
std::vector< Expr > | args |
CallType | call_type |
FunctionPtr | func |
int | value_index |
Buffer | image |
Parameter | param |
![]() | |
Type | type |
![]() | |
RefCount | ref_count |
These classes are all managed with intrusive reference counting, so we also track a reference count. | |
IRNodeType | node_type |
Each IR node subclass has a unique identifier. | |
A function call.
This can represent a call to some extern function (like sin), but it's also our multi-dimensional version of a Load, so it can be a load from an input image, or a call to another halide function. These two types of call nodes don't survive all the way down to code generation - the lowering process converts them to Load nodes.
Enumerator | |
---|---|
Image | A load from an input image. |
Extern | A call to an external C-ABI function, possibly with side-effects. |
ExternCPlusPlus | A call to an external C-ABI function, possibly with side-effects. |
PureExtern | A call to a guaranteed-side-effect-free external function. |
Halide | A call to a Func. |
Intrinsic | A possibly-side-effecty compiler intrinsic, which has special handling during codegen. |
PureIntrinsic | A side-effect-free version of the above. |
|
static |
Referenced by is_intrinsic().
|
static |
|
static |
|
static |
Convenience constructor for calls to other halide functions.
|
inlinestatic |
Convenience constructor for loads from concrete images.
Definition at line 693 of file IR.h.
References args, Image, image, make(), Halide::Buffer< T, Dims >::name(), and Halide::Buffer< T, Dims >::type().
|
inlinestatic |
Convenience constructor for loads from images parameters.
Definition at line 698 of file IR.h.
References args, Image, make(), Halide::Parameter::name(), param, and Halide::Parameter::type().
|
inline |
Check if a call node is pure within a pipeline, meaning that the same args always give the same result, and the calls can be reordered, duplicated, unified, etc without changing the meaning of anything.
Not transitive - doesn't guarantee the args themselves are pure. An example of a pure Call node is sqrt. If in doubt, don't mark a Call node as pure.
Definition at line 708 of file IR.h.
References call_type, Image, PureExtern, and PureIntrinsic.
|
inline |
Definition at line 714 of file IR.h.
References call_type, Intrinsic, and PureIntrinsic.
Referenced by is_intrinsic(), is_intrinsic(), is_tag(), Halide::Internal::IRMatcher::Intrin< Args >::match(), and Halide::Internal::IRMatcher::Overflow::match().
|
inline |
Definition at line 719 of file IR.h.
References get_intrinsic_name(), and is_intrinsic().
|
inline |
Definition at line 723 of file IR.h.
References Halide::cast(), and is_intrinsic().
|
inline |
Definition at line 732 of file IR.h.
References is_intrinsic(), likely, likely_if_innermost, and strict_float.
|
inlinestatic |
Returns a pointer to a call node if the expression is a call to one of the requested intrinsics.
Definition at line 738 of file IR.h.
References Halide::Internal::IRHandle::as(), and Halide::cast().
Referenced by as_tag().
Definition at line 749 of file IR.h.
References as_intrinsic(), likely, likely_if_innermost, and strict_float.
|
inline |
Definition at line 753 of file IR.h.
References call_type, Extern, ExternCPlusPlus, and PureExtern.
std::string Halide::Internal::Call::name |
Definition at line 491 of file IR.h.
Referenced by Halide::SimdOpCheckTest::check_one().
std::vector<Expr> Halide::Internal::Call::args |
Definition at line 492 of file IR.h.
Referenced by Halide::SimdOpCheckTest::check_one(), make(), and make().
CallType Halide::Internal::Call::call_type |
Definition at line 501 of file IR.h.
Referenced by Halide::SimdOpCheckTest::check_one(), is_extern(), is_intrinsic(), and is_pure().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
FunctionPtr Halide::Internal::Call::func |
Definition at line 667 of file IR.h.
Referenced by Halide::SimdOpCheckTest::check_one().
|
static |
Definition at line 759 of file IR.h.
Referenced by Halide::Internal::IRMatcher::Overflow::match().