Skip to content

[ARITH] More caninical simplfy #561

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

Merged
merged 2 commits into from
Oct 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion HalideIR
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ lib/libtvm_web_runtime.js: lib/libtvm_web_runtime.bc
$(LIB_HALIDEIR): LIBHALIDEIR

LIBHALIDEIR:
+ cd HalideIR; make lib/libHalideIR.a ; cd $(ROOTDIR)
+ cd HalideIR; make lib/libHalideIR.a DMLC_CORE_PATH=../dmlc-core; cd $(ROOTDIR)

cpplint:
python dmlc-core/scripts/lint.py topi cpp topi/include;
Expand Down
7 changes: 7 additions & 0 deletions src/arithmetic/canonical.cc
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@ class Canonical::Internal : public IRMutator {
Expr Mutate_(const Mod* op, const Expr& e) final {
return Binary(op, e);
}
Expr Mutate_(const And* op, const Expr& e) final {
Expr expr = IRMutator::Mutate_(op, e);
op = expr.as<And>();
if (is_one(op->a)) return op->b;
if (is_one(op->b)) return op->a;
return expr;
}
// Call
Expr Mutate_(const Call* op, const Expr& e) final {
if (!op->is_pure()) {
Expand Down