slyubomirsky opened a new pull request, #15140:
URL: https://github.com/apache/tvm/pull/15140

   This PR implements the proposal in #14899. Namely, the `@R.function` 
decorator now has an optional `private` attribute. If a function is marked as 
private, then it will not have a global symbol attached to it and thus will not 
be externally accessible. By default, functions are not private, so the parser 
does insert a global symbol for them.
   
   Here is an example of how to use the privacy attribute:
   ```python
   @I.ir_module
   class Module:
       # Will not have a global symbol! Often not very useful to make main 
private...
       @R.function(private=True)
       def main(...): ...
   ```
   
   Passes that introduce new functions should decide whether a global symbol 
should be included with those functions. Most of the time, this is not the case 
(e.g., the functions extracted by the lambda lifting pass probably should not 
be publicly accessible).
   
   Note that there are alternative approaches we can consider. For example, we 
may have "private" as a field on a function node and fill in the global symbol 
attributes _later_. This may be important for some passes.


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