Skip to content
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] Fix lowering of FloorMod #4236

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

sgrechanik-h
Copy link
Contributor

No description provided.

@@ -136,8 +136,7 @@ class IntrinInjecter : public arith::IRMutatorWithAnalyzer {

if (analyzer_->CanProveGreaterEqual(op->b, 0)) {
// Common pass, positive divisor
if (analyzer_->CanProveGreaterEqual(op->a, 0) ||
analyzer_->CanProveGreaterEqual(e, 0)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to keep the condition of e>=0, as it can sometimes imply a>=0 but we cannot directly prove it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But floordiv(a, b) = e >= 0 always holds at this point (because b >= 0, and floordiv is always non-negative in this case).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really, unless you meant floormod

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I indeed meant floordmod (and we are in the FloorMod function).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, sorry about that

@tqchen tqchen merged commit bafc675 into apache:master Nov 1, 2019
@tqchen
Copy link
Member

tqchen commented Nov 1, 2019

Thanks @sgrechanik-h !

@sgrechanik-h sgrechanik-h deleted the pr-fix-lowering-floormod branch November 3, 2019 17:49
zxy844288792 pushed a commit to neo-ai/tvm that referenced this pull request Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants