This is an automated email from the ASF dual-hosted git repository.
tlopex 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 7fe8760076 [TIR] Fix tir.LowerIntrin check failed
additional_info.size() == new_size (#18514)
7fe8760076 is described below
commit 7fe876007683e55c49ff4aebc3a16280002265e1
Author: Neo Chien <[email protected]>
AuthorDate: Fri Nov 28 13:57:36 2025 +0800
[TIR] Fix tir.LowerIntrin check failed additional_info.size() == new_size
(#18514)
Hi Reviewers,
This PR is trying to fix issues
https://github.com/apache/tvm/issues/17388. Any suggestions would be
appreciated if you are available.
### Root Cause:
The recovery functions assumed the vector size wouldn't change during
the context's lifetime, but nested contexts would modify it. Each
constraint context modifies the same `additional_info_` vector in
`ConstIntBoundAnalyzer`.
### Solution:
- Removed the strict `ICHECK_EQ(additional_info_.size(), new_size)`
assertion
- Modified the recovery function to simply resize back to the original
size when the vector has grown
Co-authored-by: cchung100m <[email protected]>
---
src/arith/const_int_bound.cc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/arith/const_int_bound.cc b/src/arith/const_int_bound.cc
index d8296bafd9..6dd029e136 100644
--- a/src/arith/const_int_bound.cc
+++ b/src/arith/const_int_bound.cc
@@ -502,10 +502,10 @@ class ConstIntBoundAnalyzer::Impl
if (info.size() == 0) return nullptr;
size_t old_size = additional_info_.size();
additional_info_.insert(additional_info_.end(), info.begin(), info.end());
- size_t new_size = old_size + info.size();
- auto frecover = [old_size, new_size, this]() {
- ICHECK_EQ(additional_info_.size(), new_size);
- additional_info_.resize(old_size);
+ auto frecover = [old_size, this]() {
+ if (additional_info_.size() > old_size) {
+ additional_info_.resize(old_size);
+ }
};
return frecover;
}