Skip to content

Commit f3f97c2

Browse files
committed
[TIR] Regression test for PrettyPrint/IterMapExpr bugfix
Follow-up from apache#11412, adding a regression test for the bugfix.
1 parent 5655fa8 commit f3f97c2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/python/unittest/test_arith_intset.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,23 @@ def do_test_point_access(point, predicates, var_dom, expect):
322322
)
323323

324324

325+
def test_region_lower_bound_unfusable():
326+
# This test is designed to trigger an error in DetectIterMap,
327+
# resulting from a numerator which required multiple input
328+
# variables. The bug resulted in an exception being thrown,
329+
# rather than a return value of None.
330+
var_dom = {
331+
tvm.tir.Var("i", "int32"): tvm.ir.Range(8),
332+
tvm.tir.Var("j", "int32"): tvm.ir.Range(4),
333+
}
334+
i, j = var_dom
335+
region = [
336+
tvm.ir.Range.from_min_extent((i + j) // 2, 1),
337+
]
338+
result = tvm.arith.estimate_region_lower_bound(region, var_dom, predicate=True)
339+
assert result is None
340+
341+
325342
def test_union_lower_bound():
326343
neg_inf = tvm.arith.int_set.neg_inf()
327344
pos_inf = tvm.arith.int_set.pos_inf()

0 commit comments

Comments
 (0)