d-smirnov commented on code in PR #10189:
URL: https://github.com/apache/tvm/pull/10189#discussion_r894391068


##########
src/tir/usmp/transform/assign_pool_info.cc:
##########
@@ -49,18 +49,35 @@ class PoolInfoAssigner : public StmtExprMutator {
     WorkspaceMemoryPools workspace_pools =
         module->GetAttr<WorkspaceMemoryPools>(tvm::attr::kWorkspaceMemoryPools)
             .value_or(WorkspaceMemoryPools({CreateDefaultMemoryPool(module)}));
-    Array<PoolInfo> pool_infos = workspace_pools->pools;
-    for (const PoolInfo& pool_info : pool_infos) {
-      for (const auto& kv : pool_info->target_access) {
-        Target target = kv.first;
-        String target_str = target->str();
-        if (target_pool_infos_.find(target_str) == target_pool_infos_.end()) {
-          target_pool_infos_.Set(target_str, Array<PoolInfo>());
+    // make default ConstantPoolInfo if no constant and no workspace pool 
infos supplied
+    ConstantMemoryPools constant_pools =
+        module->GetAttr<ConstantMemoryPools>(tvm::attr::kConstantMemoryPools)
+            .value_or(
+                
module->GetAttr<WorkspaceMemoryPools>(tvm::attr::kWorkspaceMemoryPools).defined()
+                    ? ConstantMemoryPools()
+                    : ConstantMemoryPools({ConstantPoolInfo(

Review Comment:
   extracted



-- 
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]

Reply via email to