wrongtest commented on code in PR #11287:
URL: https://github.com/apache/tvm/pull/11287#discussion_r884082835
##########
src/arith/iter_affine_map.cc:
##########
@@ -1659,7 +1676,7 @@ bool IterMapRewriter::CanProveDivisible(const PrimExpr&
lhs, const PrimExpr& rhs
PrimExpr divisor = normalizer.Convert(rhs);
return analyzer_->CanProveEqual(dividend, divisor) ||
- analyzer_->CanProve(floormod(dividend, divisor) == 0);
+ analyzer_->CanProve(analyzer_->Simplify(floormod(dividend, divisor),
8) == 0);
Review Comment:
Sorry, that is something forget to revert. There is some cases the division
could not be proved like
`floormod(0 + -x * 8, x) == 0`, `floormod(8*c1*c2, c1) == 0`, even we
increate iteration num. They get work-around here and there, for example,
```c++
if (CanProveDivisible(right_edge, divisor)) {
right_pad = 0;
} else {
right_pad = analyzer_->Simplify(floormod(-right_edge, divisor));
}
```
@Lunderberg suggest `Simplify` could be optimized to iterate until reaching
fix point. But now it is suffice to work on existing tests.
--
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]