tqchen commented on code in PR #18330:
URL: https://github.com/apache/tvm/pull/18330#discussion_r2366298922
##########
src/arith/int_set.cc:
##########
@@ -321,6 +323,39 @@ inline IntervalSet Combine<tir::FloorMod>(Analyzer*
analyzer, IntervalSet a, Int
return IntervalSet(tmin, tmax);
}
}
+ // Enhanced: Use ModularSet analysis for better bounds
+ if (auto* div_imm = divisor.as<tir::IntImmNode>()) {
+ int64_t div_val = div_imm->value;
+
+ // Analyze the modular properties of the dividend
+ ModularSet dividend_mod = analyzer->modular_set(op->a);
+
+ if (dividend_mod.defined() && dividend_mod->coeff > 0) {
+ // Calculate GCD of dividend coefficient and divisor
+ int64_t gcd = 1;
+ if (dividend_mod->coeff != 0 && div_val != 0) {
Review Comment:
call
https://github.com/apache/tvm/blob/main/src/arith/int_operator.h#L171 instead
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]