gigiblender commented on code in PR #12066:
URL: https://github.com/apache/tvm/pull/12066#discussion_r931142219


##########
src/relay/backend/te_compiler.cc:
##########
@@ -134,30 +135,38 @@ TVM_REGISTER_OBJECT_TYPE(TECompilerNode);
 
 class TECompilerImpl : public TECompilerNode {
  public:
-  explicit TECompilerImpl(Optional<IRModule> opt_mod) {
+  explicit TECompilerImpl(Optional<IRModule> opt_mod, Optional<String> 
opt_mod_name) {
+    String mod_name;
+    if (!opt_mod_name) {
+      mod_name = "";
+    } else {
+      mod_name = opt_mod_name.value();
+    }
+    NameSupply name_supply = NameSupply(mod_name);
+    global_var_supply = GlobalVarSupply(name_supply);
     // Make sure we don't collide with any existing globals in the module.
     if (opt_mod) {
       for (const auto& kv : opt_mod.value()->functions) {
-        name_map_[kv.first->name_hint] = 1;
+        global_var_supply->name_supply_->ReserveName(kv.first->name_hint, 
false);
       }
     }
   }
 
   // Lower the function.
-  CachedFunc Lower(const CCacheKey& key, std::function<String(String)> 
mangle_fn) {
-    return LowerInternal(key, mangle_fn)->cached_func;
+  CachedFunc Lower(const CCacheKey& key) {
+    return LowerInternal(key, global_var_supply)->cached_func;
   }
 
+  // TODO(gigiblender): Only to be called by the GlobalTECompiler.

Review Comment:
   
https://github.com/apache/tvm/blob/97269fa479f4844a20ca680e54d0caaf3401a855/src/relay/backend/te_compiler.cc#L547
   
   I was referring to this global. I changed it from GlobalTECompiler to 
`global TE compiler` as in the original comment.



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