Loading...
Searching...
No Matches
Halide::Internal::IRHandle Struct Reference

IR nodes are passed around opaque handles to them. More...

`#include <Expr.h>`

Inheritance diagram for Halide::Internal::IRHandle:

## Public Member Functions

HALIDE_ALWAYS_INLINE | IRHandle ()=default
HALIDE_ALWAYS_INLINE | IRHandle (const IRNode *p)
void | accept (IRVisitor *v) const
| Dispatch to the correct visitor method for this node.
template<typename T>
const T * | as () const
| Downcast this ir node to its actual type (e.g.
IRNodeType | node_type () const
Public Member Functions inherited from Halide::Internal::IntrusivePtr< const IRNode >
const IRNode * | get () const
| Access the raw pointer in a variety of ways.
const IRNode & | operator* () const
const IRNode * | operator-> () const
| ~IntrusivePtr ()
HALIDE_ALWAYS_INLINE | IntrusivePtr ()=default
IntrusivePtr< const IRNode > & | operator= (const IntrusivePtr< const IRNode > &other)
HALIDE_ALWAYS_INLINE bool | defined () const
HALIDE_ALWAYS_INLINE bool | same_as (const IntrusivePtr &other) const
HALIDE_ALWAYS_INLINE bool | operator< (const IntrusivePtr< const IRNode > &other) const
HALIDE_ALWAYS_INLINE bool | is_sole_reference () const

## Additional Inherited Members

Protected Attributes inherited from Halide::Internal::IntrusivePtr< const IRNode >
const IRNode * | ptr

## Detailed Description

IR nodes are passed around opaque handles to them.

This is a base class for those handles. It manages the reference count, and dispatches visitors.

Definition at line 180 of file Expr.h.

## Constructor & Destructor Documentation

## IRHandle() [1/2]

HALIDE_ALWAYS_INLINE Halide::Internal::IRHandle::IRHandle | ( |  | ) |

default

References HALIDE_ALWAYS_INLINE.

Referenced by Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), Halide::Expr::Expr(), and Halide::Internal::Stmt::Stmt().

## IRHandle() [2/2]

HALIDE_ALWAYS_INLINE Halide::Internal::IRHandle::IRHandle | ( | const IRNode * | p | ) |

inline

Definition at line 185 of file Expr.h.

References Halide::Internal::IntrusivePtr< const IRNode >::IntrusivePtr().

## Member Function Documentation

## accept()

void Halide::Internal::IRHandle::accept | ( | IRVisitor * | v | ) | const

inline

Dispatch to the correct visitor method for this node.

E.g. if this node is actually an Add node, then this will call IRVisitor::visit(const Add *)

Definition at line 192 of file Expr.h.

References Halide::Internal::IntrusivePtr< const IRNode >::ptr.

Referenced by Halide::SimdOpCheckTest::check_one().

## as()

template<typename T>

const T * Halide::Internal::IRHandle::as | ( |  | ) | const

inline

Downcast this ir node to its actual type (e.g.

Add, or Select). This returns nullptr if the node is not of the requested type. Example usage:

if (const Add *add = node->as<Add>()) { // This is an add node }

Definition at line 205 of file Expr.h.

References Halide::Internal::IntrusivePtr< const IRNode >::ptr.

Referenced by Halide::Internal::Call::as_intrinsic(), Halide::Internal::equal(), Halide::Internal::HexagonAlignmentAnalyzer::is_aligned_impl(), and Halide::Internal::Simplify::should_commute().

## node_type()

IRNodeType Halide::Internal::IRHandle::node_type | ( |  | ) | const

inline

Definition at line 212 of file Expr.h.

References Halide::Internal::IntrusivePtr< const IRNode >::ptr.

Referenced by Halide::Internal::Simplify::should_commute().

The documentation for this struct was generated from the following file:

- src/Expr.h