if isinstance(expr, Integral):
return expr == value
if not isinstance(expr, tvm.tir.IntImm):
expr = tvm.tir.ir_pass.Simplify(expr)
if not isinstance(expr, tvm.tir.IntImm):
return False
return expr.value == value
After Change
if isinstance(expr, Integral):
return expr == value
if not isinstance(expr, tvm.tir.IntImm):
ana = tvm.arith.Analyzer()expr = ana.simplify(expr)
if not isinstance(expr, tvm.tir.IntImm):
return False
return expr.value == value