You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/05/09 23:17:26 UTC

[GitHub] [tvm] vinx13 commented on a diff in pull request #11254: Avoid use of MemoryInfo when undefined in StorageRewrite

vinx13 commented on code in PR #11254:
URL: https://github.com/apache/tvm/pull/11254#discussion_r868578233


##########
src/tir/transforms/storage_rewrite.cc:
##########
@@ -661,9 +661,11 @@ class StoragePlanRewriter : public StmtExprMutator {
                                   e->allocs[0]->condition, Evaluate(0));
           if (IsSpecialTaggedMemory(e->scope)) {
             MemoryInfo info = GetMemoryInfo(e->scope.to_string());
-            uint64_t total_elem = e->const_nbits / e->elem_type.bits();
-            ICHECK_LE(total_elem * e->elem_type.bits(), info->max_num_bits)
-                << "Allocation exceed bound of memory tag " << e->scope.to_string();
+            if (info.defined()) {
+              uint64_t total_elem = e->const_nbits / e->elem_type.bits();
+              ICHECK_LE(total_elem * e->elem_type.bits(), info->max_num_bits)
+                  << "Allocation exceed bound of memory tag " << e->scope.to_string();
+            }

Review Comment:
   shall we throw a warning / error if memory info is not defined?



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org