kparzysz-quic commented on a change in pull request #8516:
URL: https://github.com/apache/tvm/pull/8516#discussion_r677730085
##########
File path: src/tir/transforms/inject_copy_intrin.cc
##########
@@ -157,19 +155,12 @@ class CopyIntrinInjector : public StmtMutator {
}
// Get storage scope
std::string GetStorageScope(const VarNode* var) const {
Review comment:
This function isn't used anymore, you can remove it altogether.
##########
File path: python/tvm/contrib/hexagon.py
##########
@@ -176,23 +176,26 @@ def buf_align(var):
def visit(stmt):
"""Collect information about VTCM buffers and their alignments."""
if isinstance(stmt, tvm.tir.AttrStmt):
- if stmt.attr_key == "storage_scope" and stmt.value == "local.vtcm":
- vtcm_buffers.append(stmt.node)
- elif stmt.attr_key == "storage_alignment":
+ if stmt.attr_key == "storage_alignment":
if not stmt.node in alignments:
alignments[stmt.node] = []
alignments[stmt.node].append(stmt.value)
+ elif isinstance(stmt, tvm.tir.Allocate):
+ scope = stmt.buffer_var.type_annotation.storage_scope
+ if scope == "local.vtcm":
+ vtcm_buffers.append(stmt.buffer_var)
def mutate(stmt):
"""Insert calls to VTCM allocation and deallocation routines."""
if isinstance(stmt, tvm.tir.AttrStmt):
- if stmt.attr_key == "storage_scope" and stmt.value == "local.vtcm":
- vtcm_buffers.pop()
- elif stmt.attr_key == "storage_alignment":
+ if stmt.attr_key == "storage_alignment":
alignments[stmt.node].pop()
return stmt
if isinstance(stmt, tvm.tir.Allocate):
var = stmt.buffer_var
+ scope = var.type_annotation.storage_scope
+ if scope == "local.vtcm":
+ vtcm_buffers.pop()
if var in vtcm_buffers:
Review comment:
Looks ok.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]