Indeed the name_hint
field in GlobalVar is supposed to work for that purpose(a hint rather than a fixed name). In TIR and likely broadly, we use global_symbol
attr to indicate the externally enforced name(which can not change) and that name can be referenced externally and we cannot change it during compilation.
Followup on @areusch 's point merge the IRModules so that mangling transforms are applied globally
Agreed, alternatively, we still allow user to separate modules, where cross module interaction are done through a fixed global_symbol
, which is less ideal but needed sometime. The encouraged path is to always hold as much as possible internally.