Go to the documentation of this file. 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) {
57 int native_lanes = required_alignment / op->
type.
bytes();
HALIDE_ALWAYS_INLINE auto ramp(A &&a, B &&b, C &&c) noexcept -> RampOp< decltype(pattern_arg(a)), decltype(pattern_arg(b)), decltype(pattern_arg(c))>
#define internal_assert(c)
int bytes() const
The number of bytes required to store a single scalar value of this type.
HALIDE_ALWAYS_INLINE bool is_vector() const
Is this type a vector type? (lanes() != 1).
Load a value from a named symbol if predicate is true.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
ALWAYS_INLINE size_t aligned_offset(size_t offset, size_t alignment)
@ Internal
Not visible externally, similar to 'static' linkage in C.
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...
A linear ramp vector node.
HALIDE_ALWAYS_INLINE Type type() const
Get the type of this expression node.
For optional debugging during codegen, use the debug class as follows:
signed __INT64_TYPE__ int64_t
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
bool is_aligned(const Load *op, int64_t *aligned_offset)
HexagonAlignmentAnalyzer(int required_alignment)
bool is_aligned(const Store *op, int64_t *aligned_offset)
A fragment of Halide syntax.
const T * as() const
Downcast this ir node to its actual type (e.g.