2424#ifndef TVM_ARITH_PRESBURGER_SET_H_
2525#define TVM_ARITH_PRESBURGER_SET_H_
2626
27+ #ifdef TVM_MLIR_VERSION
2728#if TVM_MLIR_VERSION >= 150
2829#include < mlir/Analysis/Presburger/IntegerRelation.h>
2930#include < mlir/Analysis/Presburger/PresburgerRelation.h>
3031#include < mlir/Analysis/Presburger/Simplex.h>
3132#endif
33+ #endif
3234
3335#include < tvm/arith/analyzer.h>
3436#include < tvm/tir/op.h>
4143namespace tvm {
4244namespace arith {
4345
46+ #ifdef TVM_MLIR_VERSION
4447#if TVM_MLIR_VERSION >= 150
4548using namespace mlir ;
4649using namespace presburger ;
@@ -150,7 +153,8 @@ class PresburgerSet : public IntSet {
150153 TVM_DEFINE_OBJECT_REF_COW_METHOD (PresburgerSetNode);
151154 TVM_DEFINE_OBJECT_REF_METHODS (PresburgerSet, IntSet, PresburgerSetNode);
152155};
153- #else
156+ #endif // TVM_MLIR_VERSION >= 150
157+ #else // TVM_MLIR_VERSION
154158// Class definition when MLIR is not enabled, to prevent compile-time error.
155159class PresburgerSetNode : public IntSetNode {
156160 public:
@@ -170,13 +174,13 @@ class PresburgerSet : public IntSet {
170174 */
171175 TVM_DLL PresburgerSet (const PrimExpr& constraint) { LOG (FATAL) << " MLIR is not enabled!" ; }
172176};
173- #endif
177+ #endif // TVM_MLIR_VERSION
174178/* !
175179 * \brief Create a union set of all sets
176180 * \param sets The sets to be combined
177181 * \return the set after union
178182 */
179- PresburgerSet Union (const Array<PresburgerSet> sets);
183+ PresburgerSet Union (const Array<PresburgerSet>& sets);
180184
181185/* !
182186 * \brief Create an intersected set of all sets
0 commit comments