diff --git a/.gitignore b/.gitignore index 137569e7960b..4c93306a9e36 100644 --- a/.gitignore +++ b/.gitignore @@ -127,9 +127,11 @@ jvm/*/*/target/ !default.perspectivev3 xcuserdata/ +.emscripten* +.m2 + ## Other *.moved-aside *.xccheckout *.xcscmblueprint .DS_Store - diff --git a/src/arithmetic/canonical.cc b/src/arithmetic/canonical.cc index 5c579f37ef30..1a48779b79e3 100644 --- a/src/arithmetic/canonical.cc +++ b/src/arithmetic/canonical.cc @@ -113,6 +113,7 @@ struct BinaryExpr { } }; + template inline Expr Binary_(const T* op, const Expr& e, @@ -282,6 +283,7 @@ class Canonical::Internal : public IRMutator { } // IntImm Expr Mutate_(const IntImm* op, const Expr& e) final { + if (op->type != Int(32)) return e; auto it = cache_intimm_.find(op->value); if (it != cache_intimm_.end()) { return it->second; diff --git a/src/pass/storage_rewrite.cc b/src/pass/storage_rewrite.cc index eeb39a1c1f28..bca7adc671cf 100644 --- a/src/pass/storage_rewrite.cc +++ b/src/pass/storage_rewrite.cc @@ -239,17 +239,18 @@ class StoragePlanRewriter : public IRMutator { const Variable* buffer = op->args[1].as(); auto it = alloc_map_.find(buffer); if (it == alloc_map_.end()) return IRMutator::Mutate_(op, e); - const StorageEntry* e = it->second; + const StorageEntry* se = it->second; Expr offset = Mutate(op->args[2]); Expr extent = Mutate(op->args[3]); - CHECK_EQ(e->elem_type, dtype.element_of()); - CHECK_EQ(e->elem_offset % dtype.lanes(), 0); - if (e->elem_offset != 0) { - offset = make_const(offset.type(), e->elem_offset / dtype.lanes()) + offset; + CHECK_EQ(se->elem_type, dtype.element_of()) + << " buffer=" << buffer->name_hint; + CHECK_EQ(se->elem_offset % dtype.lanes(), 0); + if (se->elem_offset != 0) { + offset = make_const(offset.type(), se->elem_offset / dtype.lanes()) + offset; } return Call::make( op->type, op->name, - {op->args[0], e->alloc_var, offset, extent, op->args[4]}, + {op->args[0], se->alloc_var, offset, extent, op->args[4]}, op->call_type); } else { return IRMutator::Mutate_(op, e);