Skip to content

Commit

Permalink
remove attr::realize_scope from storage_flatten
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Jun 29, 2021
1 parent e20e195 commit b382bb3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/tir/transforms/storage_flatten.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ class StorageFlattener : public StmtExprMutator {
}

Stmt VisitStmt_(const AttrStmtNode* op) final {
if (op->attr_key == attr::realize_scope) {
storage_scope_[op->node.get()] = op->value.as<StringImmNode>()->value;
return this->VisitStmt(op->body);
} else if (op->attr_key == attr::double_buffer_scope &&
op->node->IsInstance<tir::BufferNode>()) {
if (op->attr_key == attr::double_buffer_scope && op->node->IsInstance<tir::BufferNode>()) {
auto buffer = Downcast<tir::Buffer>(op->node);
Stmt body = this->VisitStmt(op->body);
auto it = buf_map_.find(buffer);
Expand Down Expand Up @@ -156,10 +152,8 @@ class StorageFlattener : public StmtExprMutator {
shape.push_back(r->extent);
}
// deduce current storage scope.
auto it = storage_scope_.find(op->buffer.get());
ICHECK(it != storage_scope_.end()) << "Cannot find storage scope of " << op->buffer;
StorageScope skey;
const std::string& strkey = it->second;
std::string strkey = GetStorageScope(op->buffer->data);
if (strkey.length() == 0) {
if (curr_thread_scope_.size() != 0) {
skey.rank = runtime::DefaultStorageRank(curr_thread_scope_.back().rank);
Expand Down Expand Up @@ -491,8 +485,6 @@ class StorageFlattener : public StmtExprMutator {
std::unordered_map<Buffer, BufferEntry, ObjectPtrHash, ObjectPtrEqual> buf_map_;
// Dimension alignment
std::unordered_map<Buffer, std::vector<DimAlignInfo>, ObjectPtrHash, ObjectPtrEqual> dim_align_;
// Storage scope
std::unordered_map<const Object*, std::string> storage_scope_;
// The current thread scope.
std::vector<ThreadScope> curr_thread_scope_;
// Collects shapes.
Expand Down

0 comments on commit b382bb3

Please sign in to comment.