mbaret commented on a change in pull request #6697:
URL: https://github.com/apache/incubator-tvm/pull/6697#discussion_r508822425



##########
File path: src/relay/backend/contrib/codegen_c/codegen.cc
##########
@@ -290,8 +290,37 @@ runtime::Module CCompiler(const ObjectRef& ref) {
   return csource.CreateCSourceModule(ref);
 }
 
+/*!
+ * \brief A visitor to add the constants used as params for MetadataModule.
+ */
+struct CCompilerConstantUpdater : public ExprVisitor {

Review comment:
       The concern is that the ConstantUpdater has no direct coupling with the 
external codegens, and yet it is generic. That is to say, the C Compiler 
codegen _must_ visit and name its constants in the same way that the 
ConstantUpdater chooses to, or you get a runtime failure. However, this 
relationship isn't enforced by any mechanism and relies on the codegen 
implementer to understand they must follow the convention. A simple example 
where this may happen is if a codegen only wants to save some constants and not 
others - the Ethos-N codegen being an extreme example where it wants to save 
none of them.




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