d-smirnov commented on code in PR #10189:
URL: https://github.com/apache/tvm/pull/10189#discussion_r897131687
##########
src/tir/usmp/analysis/extract_buffer_info.cc:
##########
@@ -505,6 +572,41 @@ BufferInfoAnalysis BufferInfoExtractor::operator()(const
PrimFunc& main_func) {
open_set.erase(le_event.buffer_info);
}
}
+
+ // All ConstantPoolInfo items should have conflicts with each other
+ // as they will be placed in RO segment and pre-initialized
+
+ // split buffers to vars (WorkspacePoolInfo items) and constants
(ConstantPoolInfo items)
+ Array<BufferInfo> buffer_info_vars;
+ Array<BufferInfo> buffer_info_constants;
+ for (const auto& kv : this->buffer_info_map_) {
+ const auto& stmt = kv.second;
+ if (stmt->IsInstance<AllocateConstNode>()) {
+ buffer_info_constants.push_back(kv.first);
+ } else {
+ buffer_info_vars.push_back(kv.first);
+ }
+ }
+ ICHECK(buffer_info_map_.size() == buffer_info_vars.size() +
buffer_info_constants.size())
+ << "missing value";
+
+ Map<ObjectRef, ObjectRef> srch;
+ // intersect with each other, as all constants should exist at the same time
Review Comment:
no. this is an attempt to describe logic of the code in steps.
--
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]