[ARITH] Use floordiv for the deduce bound#4025
Conversation
|
@tqchen @ZihengJiang @kimishpatel @xqdan Can you review this? thanks. |
|
Following a quick glance Not sure but unconditional floordiv may not be right when I put Expr cannot be simplified to constant. E.g n/3 vs floordiv(n,3). C integer div is always round towards zero. |
@kimishpatel I don't completely understand your example. Can you elaborate more?
|
|
I am more concerned about the case where analyzer can not prove that For the sake of an example, let' say In fact, one such case where proving modulo is zero fails is here: I agree with removing the tight bounds assumption and not removing the conditions directly in the loop partition now. |
Use fdiv in the tests for the deduce_bound
|
ping @tqchen @ZihengJiang |
|
@umangyadav Hey, this PR looks good overall. Could you add the example in the issue #3974 as a test case? |
|
@ZihengJiang I'd thought about it, but I found it not necessary, as the existing test cases (in I can add the test anyway if you think it would be better or alternatively I can add a test in |
|
No worries. This PR has been mergred. Thanks! @umangyadav |
Use fdiv in the tests for the deduce_bound
Use fdiv in the tests for the deduce_bound
Solves #3974