Skip to content

Commit

Permalink
Only enable PresburgerSet for llvm version >= 15
Browse files Browse the repository at this point in the history
  • Loading branch information
Min Chen committed May 2, 2023
1 parent 9a24a83 commit ddbe714
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/arith/presburger_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
namespace tvm {
namespace arith {

#ifdef TVM_MLIR_VERSION
#if TVM_MLIR_VERSION >= 150
using namespace tir;

void Update(const PrimExpr& constraint, PresburgerSetNode* intset) {
Expand Down Expand Up @@ -229,7 +229,7 @@ TVM_STATIC_IR_FUNCTOR(ReprPrinter, vtable)
p->stream << "}";
});

#endif
#endif // TVM_MLIR_VERSION

PresburgerSet MakePresburgerSet(const PrimExpr& constraint) { return PresburgerSet(constraint); }

Expand Down
4 changes: 2 additions & 2 deletions src/arith/presburger_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef TVM_ARITH_PRESBURGER_SET_H_
#define TVM_ARITH_PRESBURGER_SET_H_

#ifdef TVM_MLIR_VERSION
#if TVM_MLIR_VERSION >= 150
#include <mlir/Analysis/Presburger/IntegerRelation.h>
#include <mlir/Analysis/Presburger/PresburgerRelation.h>
#include <mlir/Analysis/Presburger/Simplex.h>
Expand All @@ -41,7 +41,7 @@
namespace tvm {
namespace arith {

#ifdef TVM_MLIR_VERSION
#if TVM_MLIR_VERSION >= 150
using namespace mlir;
using namespace presburger;

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp/arith_integer_set_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

#ifdef TVM_MLIR_VERSION
#if TVM_MLIR_VERSION >= 150
#include <dmlc/logging.h>
#include <gtest/gtest.h>
#include <tvm/arith/analyzer.h>
Expand All @@ -38,4 +38,4 @@ TEST(PresburgerSet, eval) {
ASSERT_TRUE(tvm::tir::is_zero(result.min()));
ASSERT_TRUE(tvm::tir::is_const_int(result.max(), 38));
}
#endif
#endif // TVM_MLIR_VERSION

0 comments on commit ddbe714

Please sign in to comment.