-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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