24 #ifndef TVM_ARITH_INT_SOLVER_H_
25 #define TVM_ARITH_INT_SOLVER_H_
31 #include <unordered_map>
67 refl::ObjectDef<IntGroupBoundsNode>()
95 ffi::Array<PrimExpr> upper);
146 refl::ObjectDef<IntConstraintsNode>()
170 ffi::Array<PrimExpr> relations);
198 refl::ObjectDef<IntConstraintsTransformNode>()
227 ffi::Map<Var, PrimExpr> src_to_dst,
228 ffi::Map<Var, PrimExpr> dst_to_src);
261 std::vector<PrimExpr>* x, std::vector<PrimExpr>* y);
303 const ffi::Map<Var, IntGroupBounds>& bounds,
304 const ffi::Array<PrimExpr>& relations);
Algebra expression simplifications.
Reference to PrimExprNode.
Definition: expr.h:124
Range container
Definition: expr.h:689
Represent integer constrains including (integer) variables, their ranges and the relations between th...
Definition: int_solver.h:132
ffi::Array< PrimExpr > relations
Definition: int_solver.h:142
static void RegisterReflection()
Definition: int_solver.h:144
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.IntConstraints", IntConstraintsNode, Object)
ffi::Map< Var, Range > ranges
Definition: int_solver.h:139
ffi::Array< Var > variables
Definition: int_solver.h:135
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: int_solver.h:152
Managed reference to IntConstraintsNode.
Definition: int_solver.h:160
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(IntConstraints, ObjectRef, IntConstraintsNode)
IntConstraints(ffi::Array< Var > variables, ffi::Map< Var, Range > ranges, ffi::Array< PrimExpr > relations)
Constructor by fields.
Represent integer grouped bounds which are classified into lower bounds (inclusive),...
Definition: int_solver.h:58
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.IntGroupBounds", IntGroupBoundsNode, Object)
PrimExpr coef
Definition: int_solver.h:60
static void RegisterReflection()
Definition: int_solver.h:65
ffi::Array< PrimExpr > equal
Definition: int_solver.h:62
ffi::Array< PrimExpr > upper
Definition: int_solver.h:63
ffi::Array< PrimExpr > lower
Definition: int_solver.h:61
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: int_solver.h:74
Managed reference to IntGroupBoundsNode.
Definition: int_solver.h:82
static IntGroupBounds FromRange(const Range &r)
Construct bounds from a range.
IntGroupBounds(PrimExpr coef, ffi::Array< PrimExpr > lower, ffi::Array< PrimExpr > equal, ffi::Array< PrimExpr > upper)
Constructor by fields.
Range FindBestRange(const ffi::Map< Var, Range > &vranges_addl={}) const
Find the best range from the grouped bounds.
IntGroupBounds operator+(const Range &r)
Combine the bounds with another range.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(IntGroupBounds, ObjectRef, IntGroupBoundsNode)
IntGroupBounds Substitute(const ffi::Map< Var, PrimExpr > &subst) const
Perform substitution on all components of the struct.
ffi::Array< PrimExpr > AsConditions(const ffi::Array< Var > &variables, const ffi::Map< Var, IntGroupBounds > &bounds, const ffi::Array< PrimExpr > &relations)
Combine the information into an array of (in)equalities.
std::pair< ffi::Map< Var, IntGroupBounds >, ffi::Array< PrimExpr > > PartialSolvedInequalities
Definition: int_solver.h:243
void SmithNormalFormDiag(std::vector< std::vector< int64_t >> *S, std::vector< std::vector< int64_t >> *V, std::vector< PrimExpr > *x, std::vector< PrimExpr > *y)
Obtain Smith Normal Form of linear equation A x = y. Smith Normal Form of matrix A_{mxn} is S_{mxn} =...
IntConstraints SolveInequalitiesToRange(const IntConstraints &system_to_solve)
Solve linear inequalities and infer the range of each variable.
constexpr int kSimplifyRewriteCanonicalRewrite
Definition: int_solver.h:47
IntConstraintsTransform SolveInequalitiesDeskewRange(const IntConstraints &system_to_solve)
Solve linear inequalities and deskew the ranges towards zero.
PartialSolvedInequalities SolveLinearInequalities(const IntConstraints &system_to_solve)
Solve linear inequalities.
IntConstraintsTransform SolveLinearEquations(const IntConstraints &system_to_solve)
Solve linear equations.
Definition: repr_printer.h:91
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
Common operators defined for Expr.