Commit bc543107 by Sergei Grechanik Committed by Tianqi Chen

[ARITH] Fix lowering of floormod(x, y) != 0 (#4127)

parent a0bd3786
...@@ -193,7 +193,7 @@ class IntrinInjecter : public arith::IRMutatorWithAnalyzer { ...@@ -193,7 +193,7 @@ class IntrinInjecter : public arith::IRMutatorWithAnalyzer {
using namespace arith; using namespace arith;
PVar<Expr> x, y; PVar<Expr> x, y;
if ((floormod(x, y) != 0).Match(e)) { if ((floormod(x, y) != 0).Match(e)) {
return Mutate((truncmod(x, y) == 0).Eval()); return Mutate((truncmod(x, y) != 0).Eval());
} }
return IRMutatorWithAnalyzer::Mutate_(op, e); return IRMutatorWithAnalyzer::Mutate_(op, e);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment