Halide 22.0.0 Halide compiler and libraries

Public Member Functions | List of all members
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. 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 IRNode * | get () const
| Access the raw pointer in a variety of ways. More...
const IRNode & | operator* () const
const IRNode * | operator-> () 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
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

## ◆ IRHandle() [2/2]

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

Definition at line 185 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 192 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 205 of file Expr.h.

References Halide::Internal::IRNode::node_type, and 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::IRNode::node_type, and 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