zhuwenxi commented on a change in pull request #7619:
URL: https://github.com/apache/tvm/pull/7619#discussion_r593020891



##########
File path: src/tir/transforms/lower_tvm_builtin.cc
##########
@@ -155,6 +166,25 @@ class BuiltinLower : public StmtExprMutator {
       return StmtExprMutator::VisitExpr_(op);
     }
   }
+  std::string GetUniqueName(std::string prefix) {
+    for (size_t i = 0; i < prefix.size(); ++i) {
+      if (prefix[i] == '.') prefix[i] = '_';
+    }

Review comment:
       The idea to use "std::replace" is perfect. But just to clarify, the 
whole "GetUniqueName()" function is copied from 
https://github.com/apache/tvm/blob/main/src/target/source/codegen_source_base.cc#L35.
 I searched over the whole tvm codebase and I found there are a lot components 
implement the "GetUniqueName()" function, which have pretty much the same 
functionality. What about we could make the "GetUniqueName()" a utility 
function shared by all the components, to avoid the duplication?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to