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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]