This is an automated email from the ASF dual-hosted git repository.
cbalint13 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new f75b563e19 [LLVM][Arith] Presburger compile fix for MLIR/LLVM 19.x
(#17469)
f75b563e19 is described below
commit f75b563e19d9652b57a6be7286fbb1b28df09ed4
Author: Balint Cristian <[email protected]>
AuthorDate: Thu Oct 17 21:17:17 2024 +0300
[LLVM][Arith] Presburger compile fix for MLIR/LLVM 19.x (#17469)
---
src/arith/presburger_set.cc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/arith/presburger_set.cc b/src/arith/presburger_set.cc
index 3798ba1904..4f4d7e1857 100644
--- a/src/arith/presburger_set.cc
+++ b/src/arith/presburger_set.cc
@@ -215,7 +215,9 @@ PresburgerSet Intersect(const Array<PresburgerSet>& sets) {
IntSet EvalSet(const PrimExpr& e, const PresburgerSet& set) {
Array<PrimExpr> tvm_coeffs = DetectLinearEquation(e, set->GetVars());
-#if TVM_MLIR_VERSION >= 160
+#if TVM_MLIR_VERSION >= 190
+ SmallVector<llvm::DynamicAPInt> coeffs;
+#elif TVM_MLIR_VERSION >= 160
SmallVector<mlir::presburger::MPInt> coeffs;
#else
SmallVector<int64_t> coeffs;
@@ -223,7 +225,9 @@ IntSet EvalSet(const PrimExpr& e, const PresburgerSet& set)
{
coeffs.reserve(tvm_coeffs.size());
for (const PrimExpr& it : tvm_coeffs) {
-#if TVM_MLIR_VERSION >= 160
+#if TVM_MLIR_VERSION >= 190
+ coeffs.push_back(llvm::DynamicAPInt(*as_const_int(it)));
+#elif TVM_MLIR_VERSION >= 160
coeffs.push_back(mlir::presburger::MPInt(*as_const_int(it)));
#else
coeffs.push_back(*as_const_int(it));