24 #ifndef TVM_ARITH_INT_SOLVER_H_
25 #define TVM_ARITH_INT_SOLVER_H_
31 #include <unordered_map>
67 refl::ObjectDef<IntGroupBoundsNode>()
76 static constexpr
const char*
_type_key =
"arith.IntGroupBounds";
97 Array<PrimExpr> upper);
148 refl::ObjectDef<IntConstraintsNode>()
156 static constexpr
const char*
_type_key =
"arith.IntConstraints";
173 TVM_DLL
IntConstraints(Array<Var> variables, Map<Var, Range> ranges, Array<PrimExpr> relations);
201 refl::ObjectDef<IntConstraintsTransformNode>()
210 static constexpr
const char*
_type_key =
"arith.IntConstraintsTransform";
231 Map<Var, PrimExpr> src_to_dst, Map<Var, PrimExpr> dst_to_src);
263 std::vector<PrimExpr>* x, std::vector<PrimExpr>* y);
304 Array<PrimExpr>
AsConditions(
const Array<Var>& variables,
const Map<Var, IntGroupBounds>& bounds,
305 const Array<PrimExpr>& relations);
Algebra expression simplifications.
Reference to PrimExprNode.
Definition: expr.h:129
Range container
Definition: expr.h:698
Represent integer constrains including (integer) variables, their ranges and the relations between th...
Definition: int_solver.h:134
Array< PrimExpr > relations
Definition: int_solver.h:144
TVM_DECLARE_FINAL_OBJECT_INFO(IntConstraintsNode, Object)
static constexpr const char * _type_key
Definition: int_solver.h:156
static void RegisterReflection()
Definition: int_solver.h:146
Map< Var, Range > ranges
Definition: int_solver.h:141
Array< Var > variables
Definition: int_solver.h:137
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: int_solver.h:154
Managed reference to IntConstraintsNode.
Definition: int_solver.h:164
IntConstraints(Array< Var > variables, Map< Var, Range > ranges, Array< PrimExpr > relations)
Constructor by fields.
TVM_DEFINE_OBJECT_REF_METHODS(IntConstraints, ObjectRef, IntConstraintsNode)
Represent integer grouped bounds which are classified into lower bounds (inclusive),...
Definition: int_solver.h:58
static constexpr const char * _type_key
Definition: int_solver.h:76
Array< PrimExpr > upper
Definition: int_solver.h:63
PrimExpr coef
Definition: int_solver.h:60
static void RegisterReflection()
Definition: int_solver.h:65
Array< PrimExpr > equal
Definition: int_solver.h:62
Array< PrimExpr > lower
Definition: int_solver.h:61
TVM_DECLARE_FINAL_OBJECT_INFO(IntGroupBoundsNode, Object)
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: int_solver.h:74
Managed reference to IntGroupBoundsNode.
Definition: int_solver.h:84
static IntGroupBounds FromRange(const Range &r)
Construct bounds from a range.
IntGroupBounds Substitute(const Map< Var, PrimExpr > &subst) const
Perform substitution on all components of the struct.
IntGroupBounds operator+(const Range &r)
Combine the bounds with another range.
IntGroupBounds(PrimExpr coef, Array< PrimExpr > lower, Array< PrimExpr > equal, Array< PrimExpr > upper)
Constructor by fields.
Range FindBestRange(const Map< Var, Range > &vranges_addl={}) const
Find the best range from the grouped bounds.
TVM_DEFINE_OBJECT_REF_METHODS(IntGroupBounds, ObjectRef, IntGroupBoundsNode)
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
Array< PrimExpr > AsConditions(const Array< Var > &variables, const Map< Var, IntGroupBounds > &bounds, const Array< PrimExpr > &relations)
Combine the information into an array of (in)equalities.
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.
std::pair< Map< Var, IntGroupBounds >, Array< PrimExpr > > PartialSolvedInequalities
Definition: int_solver.h:245
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.