Halide
HexagonOptimize.h
Go to the documentation of this file.
1 #ifndef HALIDE_IR_HEXAGON_OPTIMIZE_H
2 #define HALIDE_IR_HEXAGON_OPTIMIZE_H
3 
4 /** \file
5  * Tools for optimizing IR for Hexagon.
6  */
7 
8 #include "Expr.h"
9 #include "Target.h"
10 
11 namespace Halide {
12 namespace Internal {
13 
14 /** Replace indirect and other loads with simple loads + vlut
15  * calls. */
16 Stmt optimize_hexagon_shuffles(const Stmt &s, int lut_alignment);
17 
18 /** Generate vtmpy instruction if possible */
19 Stmt vtmpy_generator(Stmt s);
20 
21 /* Generate vscatter-vgather instructions on Hexagon using VTCM memory.
22  * The pass should be run before generating shuffles.
23  * Some expressions which generate vscatter-vgathers are:
24  * 1. out(x) = lut(foo(x)) -> vgather
25  * 2. out(idx(x)) = foo(x) -> vscatter */
26 Stmt scatter_gather_generator(Stmt s);
27 
28 /** Hexagon deinterleaves when performing widening operations, and
29  * interleaves when performing narrowing operations. This pass
30  * rewrites widenings/narrowings to be explicit in the IR, and
31  * attempts to simplify away most of the
32  * interleaving/deinterleaving. */
33 Stmt optimize_hexagon_instructions(Stmt s, Target t);
34 
35 /** Generate deinterleave or interleave operations, operating on
36  * groups of vectors at a time. */
37 //@{
38 Expr native_deinterleave(const Expr &x);
39 Expr native_interleave(const Expr &x);
40 bool is_native_deinterleave(const Expr &x);
41 bool is_native_interleave(const Expr &x);
42 //@}
43 
44 } // namespace Internal
45 } // namespace Halide
46 
47 #endif
Target.h
Halide::Internal::native_interleave
Expr native_interleave(const Expr &x)
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AddAtomicMutex.h:21
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::Internal::is_native_interleave
bool is_native_interleave(const Expr &x)
Halide::Internal::optimize_hexagon_shuffles
Stmt optimize_hexagon_shuffles(const Stmt &s, int lut_alignment)
Replace indirect and other loads with simple loads + vlut calls.
Halide::Internal::scatter_gather_generator
Stmt scatter_gather_generator(Stmt s)
Halide::Internal::is_native_deinterleave
bool is_native_deinterleave(const Expr &x)
Expr.h
Halide::Internal::native_deinterleave
Expr native_deinterleave(const Expr &x)
Generate deinterleave or interleave operations, operating on groups of vectors at a time.
Halide::Internal::optimize_hexagon_instructions
Stmt optimize_hexagon_instructions(Stmt s, Target t)
Hexagon deinterleaves when performing widening operations, and interleaves when performing narrowing ...
Halide::Internal::vtmpy_generator
Stmt vtmpy_generator(Stmt s)
Generate vtmpy instruction if possible.