1#ifndef HALIDE_HEXAGON_ALIGNMENT_H
2#define HALIDE_HEXAGON_ALIGNMENT_H
15 const int required_alignment;
19 : required_alignment(required_alignment) {
28 debug(3) <<
"HexagonAlignmentAnalyzer: Check if " << op->index <<
" is aligned to a "
29 << required_alignment <<
" byte boundary\n"
30 <<
"native_lanes: " << native_lanes <<
"\n";
31 Expr index = op->index;
36 debug(3) <<
"Is Unaligned\n";
40 internal_assert(native_lanes != 0) <<
"Type is larger than required alignment of " << required_alignment <<
" bytes\n";
45 if (op->param.defined() && ((op->param.host_alignment() % required_alignment) != 0)) {
49 bool known_alignment = (op->alignment.modulus % native_lanes) == 0;
50 if (known_alignment) {
51 *aligned_offset = op->alignment.remainder % native_lanes;
53 return known_alignment && (*aligned_offset == 0);
57 int native_lanes = required_alignment / op->
type.
bytes();
#define internal_assert(c)
Subtypes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
HexagonAlignmentAnalyzer(int required_alignment)
bool is_aligned(const Load *op, int64_t *aligned_offset)
bool is_aligned_impl(const T *op, int native_lanes, int64_t *aligned_offset)
Analyze the index of a load/store instruction for alignment Returns true if it can determing that the...
bool is_aligned(const Store *op, int64_t *aligned_offset)
For optional debugging during codegen, use the debug class as follows:
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
signed __INT64_TYPE__ int64_t
A fragment of Halide syntax.
HALIDE_ALWAYS_INLINE Type type() const
Get the type of this expression node.
const T * as() const
Downcast this ir node to its actual type (e.g.
Load a value from a named symbol if predicate is true.
A linear ramp vector node.
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
HALIDE_ALWAYS_INLINE bool is_vector() const
Is this type a vector type? (lanes() != 1).
int bytes() const
The number of bytes required to store a single scalar value of this type.