1#ifndef HALIDE_MODULUS_REMAINDER_H
2#define HALIDE_MODULUS_REMAINDER_H
#define HALIDE_MUST_USE_RESULT
Various utility functions used internally Halide.
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Le...
ConstantInterval operator*(const ConstantInterval &a, const ConstantInterval &b)
ModulusRemainder modulus_remainder(const Expr &e)
For things like alignment analysis, often it's helpful to know if an integer expression is some multi...
int64_t gcd(int64_t, int64_t)
The greatest common divisor of two integers.
ConstantInterval operator%(const ConstantInterval &a, const ConstantInterval &b)
ConstantInterval operator/(const ConstantInterval &a, const ConstantInterval &b)
void modulus_remainder_test()
ConstantInterval operator-(const ConstantInterval &a, const ConstantInterval &b)
ConstantInterval operator+(const ConstantInterval &a, const ConstantInterval &b)
Arithmetic operators on ConstantIntervals.
HALIDE_MUST_USE_RESULT bool reduce_expr_modulo(const Expr &e, int64_t modulus, int64_t *remainder)
Reduce an expression modulo some integer.
int64_t lcm(int64_t, int64_t)
The least common multiple of two integers.
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.
The result of modulus_remainder analysis.
ModulusRemainder()=default
static ModulusRemainder unify(const ModulusRemainder &a, const ModulusRemainder &b)
ModulusRemainder(int64_t m, int64_t r)
bool operator==(const ModulusRemainder &other) const
static ModulusRemainder intersect(const ModulusRemainder &a, const ModulusRemainder &b)