diff --git a/src/arith/const_fold.h b/src/arith/const_fold.h index 0e675c6806a2a..9c3afe41b9017 100644 --- a/src/arith/const_fold.h +++ b/src/arith/const_fold.h @@ -108,7 +108,8 @@ inline PrimExpr TryConstFold(PrimExpr a, PrimExpr b) { template <> inline PrimExpr TryConstFold(PrimExpr a, PrimExpr b) { TVM_ARITH_CONST_PROPAGATION({ - ICHECK(!(pa && pa->dtype.is_uint() && pa->value == 0U && b.dtype().is_uint())) + ICHECK(!((pa && pa->dtype.is_uint() && pa->value == 0U) && + (pb && pb->dtype.is_uint() && pb->value > 0U))) << "Checked failed. Minuend 's value is 0U and it's dtype is uint " << "while Subtrahend's dtype is uint; which will cause a negative uint"; const DataType& rtype = a.dtype();