> A couple of thoughts...
> 
>     * We should have a common facility that represents a scope in which names 
> need to be unique.  Conceptually it could be a set of "known" strings (that 
> are presumed used), and something (like a private counter) to generate a 
> unique suffix.  The use would be `new_name = GenerateName("foo")`.  If `foo` 
> had already been generated, `new_name` would be set to `"foo4"` (for 
> example).  This should not produce global variables (or any IR objects), just 
> names.
>
> 
>     * This RFC still doesn't settle the question whether "name_hint" is a 
> final name or not.  I'm open to requiring that global symbols are given final 
> names from the beginning, not hints.

Thanks for the comments @kparzysz-quic. I agree that we could have the 
`NameSupply` methods return Strings and make sure that `GlobalVars` are created 
using strings provided by a NameSupply (eventually one contained within the 
IRModule). This way, the `NameSupply` could be used for other name mangling 
scenarios where GlobalVars are not needed.

Regarding the `name_hint` being a final name. I am too of this opinion (it 
should be a final name) and believe that it already works this way. If I am not 
wrong, the only edge case is where we use the `global_symbol` attribute instead.

@mbs-octoml  @tqchen any thoughts? 


-- 
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/84#issuecomment-1173984996
You are receiving this because you are subscribed to this thread.

Message ID: <apache/tvm-rfcs/pull/84/c1173984...@github.com>

Reply via email to