Halide
Halide::Internal::IRMutator2 Class Reference

A base class for passes over the IR which modify it (e.g. More...

#include <IRMutator.h>

Inherited by Halide::Internal::IRGraphMutator2, and Halide::Internal::SubstituteVarEstimates.

Public Member Functions

virtual EXPORT ~IRMutator2 ()
 
virtual EXPORT Expr mutate (const Expr &expr)
 This is the main interface for using a mutator. More...
 
virtual EXPORT Stmt mutate (const Stmt &stmt)
 
virtual EXPORT Expr visit (const IntImm *)
 
virtual EXPORT Expr visit (const UIntImm *)
 
virtual EXPORT Expr visit (const FloatImm *)
 
virtual EXPORT Expr visit (const StringImm *)
 
virtual EXPORT Expr visit (const Cast *)
 
virtual EXPORT Expr visit (const Variable *)
 
virtual EXPORT Expr visit (const Add *)
 
virtual EXPORT Expr visit (const Sub *)
 
virtual EXPORT Expr visit (const Mul *)
 
virtual EXPORT Expr visit (const Div *)
 
virtual EXPORT Expr visit (const Mod *)
 
virtual EXPORT Expr visit (const Min *)
 
virtual EXPORT Expr visit (const Max *)
 
virtual EXPORT Expr visit (const EQ *)
 
virtual EXPORT Expr visit (const NE *)
 
virtual EXPORT Expr visit (const LT *)
 
virtual EXPORT Expr visit (const LE *)
 
virtual EXPORT Expr visit (const GT *)
 
virtual EXPORT Expr visit (const GE *)
 
virtual EXPORT Expr visit (const And *)
 
virtual EXPORT Expr visit (const Or *)
 
virtual EXPORT Expr visit (const Not *)
 
virtual EXPORT Expr visit (const Select *)
 
virtual EXPORT Expr visit (const Load *)
 
virtual EXPORT Expr visit (const Ramp *)
 
virtual EXPORT Expr visit (const Broadcast *)
 
virtual EXPORT Expr visit (const Call *)
 
virtual EXPORT Expr visit (const Let *)
 
virtual EXPORT Expr visit (const Shuffle *)
 
virtual EXPORT Stmt visit (const LetStmt *)
 
virtual EXPORT Stmt visit (const AssertStmt *)
 
virtual EXPORT Stmt visit (const ProducerConsumer *)
 
virtual EXPORT Stmt visit (const For *)
 
virtual EXPORT Stmt visit (const Store *)
 
virtual EXPORT Stmt visit (const Provide *)
 
virtual EXPORT Stmt visit (const Allocate *)
 
virtual EXPORT Stmt visit (const Free *)
 
virtual EXPORT Stmt visit (const Realize *)
 
virtual EXPORT Stmt visit (const Block *)
 
virtual EXPORT Stmt visit (const IfThenElse *)
 
virtual EXPORT Stmt visit (const Evaluate *)
 
virtual EXPORT Stmt visit (const Prefetch *)
 

Detailed Description

A base class for passes over the IR which modify it (e.g.

replacing a variable with a value (Substitute.h), or constant-folding).

Your mutator should override the visit() methods you care about and return the new expression or stmt. The default implementations recursively mutate their children. To mutate sub-expressions and sub-statements you should override the mutate() method, which will dispatch to the appropriate visit() method and then return the value of expr or stmt after the call to visit.

Definition at line 124 of file IRMutator.h.

Constructor & Destructor Documentation

◆ ~IRMutator2()

virtual EXPORT Halide::Internal::IRMutator2::~IRMutator2 ( )
virtual

Member Function Documentation

◆ mutate() [1/2]

virtual EXPORT Expr Halide::Internal::IRMutator2::mutate ( const Expr expr)
virtual

This is the main interface for using a mutator.

Also call these in your subclass to mutate sub-expressions and sub-statements.

Reimplemented in Halide::Internal::IRGraphMutator2.

◆ mutate() [2/2]

virtual EXPORT Stmt Halide::Internal::IRMutator2::mutate ( const Stmt stmt)
virtual

◆ visit() [1/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const IntImm )
virtual

◆ visit() [2/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const UIntImm )
virtual

◆ visit() [3/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const FloatImm )
virtual

◆ visit() [4/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const StringImm )
virtual

◆ visit() [5/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Cast )
virtual

◆ visit() [6/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Variable )
virtual

◆ visit() [7/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Add )
virtual

◆ visit() [8/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Sub )
virtual

◆ visit() [9/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Mul )
virtual

◆ visit() [10/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Div )
virtual

◆ visit() [11/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Mod )
virtual

◆ visit() [12/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Min )
virtual

◆ visit() [13/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Max )
virtual

◆ visit() [14/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const EQ )
virtual

◆ visit() [15/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const NE )
virtual

◆ visit() [16/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const LT )
virtual

◆ visit() [17/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const LE )
virtual

◆ visit() [18/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const GT )
virtual

◆ visit() [19/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const GE )
virtual

◆ visit() [20/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const And )
virtual

◆ visit() [21/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Or )
virtual

◆ visit() [22/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Not )
virtual

◆ visit() [23/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Select )
virtual

◆ visit() [24/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Load )
virtual

◆ visit() [25/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Ramp )
virtual

◆ visit() [26/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Broadcast )
virtual

◆ visit() [27/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Call )
virtual

◆ visit() [28/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Let )
virtual

◆ visit() [29/42]

virtual EXPORT Expr Halide::Internal::IRMutator2::visit ( const Shuffle )
virtual

◆ visit() [30/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const LetStmt )
virtual

◆ visit() [31/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const AssertStmt )
virtual

◆ visit() [32/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const ProducerConsumer )
virtual

◆ visit() [33/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const For )
virtual

◆ visit() [34/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const Store )
virtual

◆ visit() [35/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const Provide )
virtual

◆ visit() [36/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const Allocate )
virtual

◆ visit() [37/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const Free )
virtual

◆ visit() [38/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const Realize )
virtual

◆ visit() [39/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const Block )
virtual

◆ visit() [40/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const IfThenElse )
virtual

◆ visit() [41/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const Evaluate )
virtual

◆ visit() [42/42]

virtual EXPORT Stmt Halide::Internal::IRMutator2::visit ( const Prefetch )
virtual

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