Commit 621337d5 by Tianqi Chen Committed by GitHub

[ARITH] More caninical simplfy (#561)

* [ARITH] More caninical simplfy

* [DEBUG] Use HalideIR with trace logging
parent 9e8bae25
Subproject commit cb3c025d5b91ab994b063a85bc935fc364d8f491 Subproject commit d91cf97d5d6cd2b47ec408bb08e978b88cbf6ab7
...@@ -225,7 +225,7 @@ lib/libtvm_web_runtime.js: lib/libtvm_web_runtime.bc ...@@ -225,7 +225,7 @@ lib/libtvm_web_runtime.js: lib/libtvm_web_runtime.bc
$(LIB_HALIDEIR): LIBHALIDEIR $(LIB_HALIDEIR): LIBHALIDEIR
LIBHALIDEIR: LIBHALIDEIR:
+ cd HalideIR; make lib/libHalideIR.a ; cd $(ROOTDIR) + cd HalideIR; make lib/libHalideIR.a DMLC_CORE_PATH=../dmlc-core; cd $(ROOTDIR)
cpplint: cpplint:
python dmlc-core/scripts/lint.py topi cpp topi/include; python dmlc-core/scripts/lint.py topi cpp topi/include;
......
...@@ -302,6 +302,13 @@ class Canonical::Internal : public IRMutator { ...@@ -302,6 +302,13 @@ class Canonical::Internal : public IRMutator {
Expr Mutate_(const Mod* op, const Expr& e) final { Expr Mutate_(const Mod* op, const Expr& e) final {
return Binary(op, e); 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 // Call
Expr Mutate_(const Call* op, const Expr& e) final { Expr Mutate_(const Call* op, const Expr& e) final {
if (!op->is_pure()) { if (!op->is_pure()) {
......
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