Halide
Halide::Internal::IRHandle Struct Reference

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

#include <Expr.h>

Inherits Halide::Internal::IntrusivePtr< const IRNode >.

Inherited by Halide::Expr, and Halide::Internal::Stmt.

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. More...
 
template<typename T >
const T * as () const
 Downcast this ir node to its actual type (e.g. More...
 
IRNodeType node_type () const
 
- Public Member Functions inherited from Halide::Internal::IntrusivePtr< const IRNode >
const IRNodeget () const
 Access the raw pointer in a variety of ways. More...
 
const IRNodeoperator* () const
 
const IRNodeoperator-> () const
 
 ~IntrusivePtr ()
 
HALIDE_ALWAYS_INLINE IntrusivePtr ()=default
 
HALIDE_ALWAYS_INLINE IntrusivePtr (const IRNode *p)
 
HALIDE_ALWAYS_INLINE IntrusivePtr (const IntrusivePtr< const IRNode > &other) noexcept
 
HALIDE_ALWAYS_INLINE IntrusivePtr (IntrusivePtr< const IRNode > &&other) noexcept
 
IntrusivePtr< const IRNode > & operator= (const IntrusivePtr< const IRNode > &other)
 
IntrusivePtr< const IRNode > & operator= (IntrusivePtr< const IRNode > &&other) noexcept
 
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
 

Additional Inherited Members

- Protected Attributes inherited from Halide::Internal::IntrusivePtr< const IRNode >
const IRNodeptr
 

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 178 of file Expr.h.

Constructor & Destructor Documentation

◆ IRHandle() [1/2]

HALIDE_ALWAYS_INLINE Halide::Internal::IRHandle::IRHandle ( )
default

◆ IRHandle() [2/2]

HALIDE_ALWAYS_INLINE Halide::Internal::IRHandle::IRHandle ( const IRNode p)
inline

Definition at line 183 of file Expr.h.

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 190 of file Expr.h.

References Halide::Internal::IRNode::accept(), and 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 203 of file Expr.h.

References Halide::Internal::IRNode::node_type, and Halide::Internal::IntrusivePtr< const IRNode >::ptr.

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

◆ node_type()

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

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