Halide  20.0.0
Halide compiler and libraries
DistributeShifts.h
Go to the documentation of this file.
1 #ifndef HALIDE_DISTRIBUTE_SHIFTS_H
2 #define HALIDE_DISTRIBUTE_SHIFTS_H
3 
4 /** \file
5  * A tool to distribute shifts as multiplies, useful for some backends. (e.g. ARM, HVX).
6  */
7 
8 #include "IR.h"
9 
10 namespace Halide {
11 namespace Internal {
12 
13 // Distributes shifts as multiplies. If `multiply_adds` is set,
14 // then only distributes the patterns `a + widening_shl(b, c)` /
15 // `a - widening_shl(b, c)` and `a + b << c` / `a - b << c`, to
16 // produce `a (+/-) widening_mul(b, 1 << c)` and `a (+/-) b * (1 << c)`,
17 // respectively
18 Stmt distribute_shifts(const Stmt &stmt, bool multiply_adds);
19 
20 } // namespace Internal
21 } // namespace Halide
22 
23 #endif
Subtypes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Stmt distribute_shifts(const Stmt &stmt, bool multiply_adds)
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A reference-counted handle to a statement node.
Definition: Expr.h:427