Halide
Halide::Internal::IRMutator Class Reference

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

#include <IRMutator.h>

Inherited by Halide::Internal::IRGraphMutator.

Public Member Functions

 IRMutator ()
 
virtual ~IRMutator ()
 
virtual Expr mutate (const Expr &expr)
 This is the main interface for using a mutator. More...
 
virtual Stmt mutate (const Stmt &stmt)
 

Protected Member Functions

virtual Expr visit (const IntImm *)
 
virtual Expr visit (const UIntImm *)
 
virtual Expr visit (const FloatImm *)
 
virtual Expr visit (const StringImm *)
 
virtual Expr visit (const Cast *)
 
virtual Expr visit (const Variable *)
 
virtual Expr visit (const Add *)
 
virtual Expr visit (const Sub *)
 
virtual Expr visit (const Mul *)
 
virtual Expr visit (const Div *)
 
virtual Expr visit (const Mod *)
 
virtual Expr visit (const Min *)
 
virtual Expr visit (const Max *)
 
virtual Expr visit (const EQ *)
 
virtual Expr visit (const NE *)
 
virtual Expr visit (const LT *)
 
virtual Expr visit (const LE *)
 
virtual Expr visit (const GT *)
 
virtual Expr visit (const GE *)
 
virtual Expr visit (const And *)
 
virtual Expr visit (const Or *)
 
virtual Expr visit (const Not *)
 
virtual Expr visit (const Select *)
 
virtual Expr visit (const Load *)
 
virtual Expr visit (const Ramp *)
 
virtual Expr visit (const Broadcast *)
 
virtual Expr visit (const Call *)
 
virtual Expr visit (const Let *)
 
virtual Expr visit (const Shuffle *)
 
virtual Expr visit (const VectorReduce *)
 
virtual Stmt visit (const LetStmt *)
 
virtual Stmt visit (const AssertStmt *)
 
virtual Stmt visit (const ProducerConsumer *)
 
virtual Stmt visit (const For *)
 
virtual Stmt visit (const Store *)
 
virtual Stmt visit (const Provide *)
 
virtual Stmt visit (const Allocate *)
 
virtual Stmt visit (const Free *)
 
virtual Stmt visit (const Realize *)
 
virtual Stmt visit (const Block *)
 
virtual Stmt visit (const IfThenElse *)
 
virtual Stmt visit (const Evaluate *)
 
virtual Stmt visit (const Prefetch *)
 
virtual Stmt visit (const Acquire *)
 
virtual Stmt visit (const Fork *)
 
virtual Stmt visit (const Atomic *)
 

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 24 of file IRMutator.h.

Constructor & Destructor Documentation

◆ IRMutator()

Halide::Internal::IRMutator::IRMutator ( )

◆ ~IRMutator()

virtual Halide::Internal::IRMutator::~IRMutator ( )
virtual

Member Function Documentation

◆ mutate() [1/2]

virtual Expr Halide::Internal::IRMutator::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::IRGraphMutator.

◆ mutate() [2/2]

virtual Stmt Halide::Internal::IRMutator::mutate ( const Stmt stmt)
virtual

◆ visit() [1/46]

virtual Expr Halide::Internal::IRMutator::visit ( const IntImm )
protectedvirtual

◆ visit() [2/46]

virtual Expr Halide::Internal::IRMutator::visit ( const UIntImm )
protectedvirtual

◆ visit() [3/46]

virtual Expr Halide::Internal::IRMutator::visit ( const FloatImm )
protectedvirtual

◆ visit() [4/46]

virtual Expr Halide::Internal::IRMutator::visit ( const StringImm )
protectedvirtual

◆ visit() [5/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Cast )
protectedvirtual

◆ visit() [6/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Variable )
protectedvirtual

◆ visit() [7/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Add )
protectedvirtual

◆ visit() [8/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Sub )
protectedvirtual

◆ visit() [9/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Mul )
protectedvirtual

◆ visit() [10/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Div )
protectedvirtual

◆ visit() [11/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Mod )
protectedvirtual

◆ visit() [12/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Min )
protectedvirtual

◆ visit() [13/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Max )
protectedvirtual

◆ visit() [14/46]

virtual Expr Halide::Internal::IRMutator::visit ( const EQ )
protectedvirtual

◆ visit() [15/46]

virtual Expr Halide::Internal::IRMutator::visit ( const NE )
protectedvirtual

◆ visit() [16/46]

virtual Expr Halide::Internal::IRMutator::visit ( const LT )
protectedvirtual

◆ visit() [17/46]

virtual Expr Halide::Internal::IRMutator::visit ( const LE )
protectedvirtual

◆ visit() [18/46]

virtual Expr Halide::Internal::IRMutator::visit ( const GT )
protectedvirtual

◆ visit() [19/46]

virtual Expr Halide::Internal::IRMutator::visit ( const GE )
protectedvirtual

◆ visit() [20/46]

virtual Expr Halide::Internal::IRMutator::visit ( const And )
protectedvirtual

◆ visit() [21/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Or )
protectedvirtual

◆ visit() [22/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Not )
protectedvirtual

◆ visit() [23/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Select )
protectedvirtual

◆ visit() [24/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Load )
protectedvirtual

◆ visit() [25/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Ramp )
protectedvirtual

◆ visit() [26/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Broadcast )
protectedvirtual

◆ visit() [27/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Call )
protectedvirtual

◆ visit() [28/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Let )
protectedvirtual

◆ visit() [29/46]

virtual Expr Halide::Internal::IRMutator::visit ( const Shuffle )
protectedvirtual

◆ visit() [30/46]

virtual Expr Halide::Internal::IRMutator::visit ( const VectorReduce )
protectedvirtual

◆ visit() [31/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const LetStmt )
protectedvirtual

◆ visit() [32/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const AssertStmt )
protectedvirtual

◆ visit() [33/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const ProducerConsumer )
protectedvirtual

◆ visit() [34/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const For )
protectedvirtual

◆ visit() [35/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Store )
protectedvirtual

◆ visit() [36/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Provide )
protectedvirtual

◆ visit() [37/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Allocate )
protectedvirtual

◆ visit() [38/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Free )
protectedvirtual

◆ visit() [39/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Realize )
protectedvirtual

◆ visit() [40/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Block )
protectedvirtual

◆ visit() [41/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const IfThenElse )
protectedvirtual

◆ visit() [42/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Evaluate )
protectedvirtual

◆ visit() [43/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Prefetch )
protectedvirtual

◆ visit() [44/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Acquire )
protectedvirtual

◆ visit() [45/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Fork )
protectedvirtual

◆ visit() [46/46]

virtual Stmt Halide::Internal::IRMutator::visit ( const Atomic )
protectedvirtual

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