Symbol look up in nested Symbol tables

Hi there,

I’m having trouble with finding the usage of a symbol where the user is in a two-level nested symbol table in parallel with where the symbol is defined. Something like:

func @symbol()

symbolTabel1 {
   symbolTable2{
      "foo.user"() {uses = [@symbol]} : () -> ()
   }
}

and I got user empty with

SymbolTable::getSymbolUses(func, symbolTable2)

I’m wondering if my use case is possible in current version of MLIR (use to be working with version about 6 months ago). What might have I done wrong with my current usage?

Thanks!

– Weiwei

You can’t reference a symbol in the parent scope using this mechanism.

@mehdi_amini Thanks for the reply!

So I’m wondering are you saying “reference a symbol in the parent scope” is just fundamentally not possible for now? Or it’s just because the mechanism I’m using is not correct? If latter, would you mind enlighten me what is the right mechanism to achieve this?

It is just fundamentally not possible. You would need to reference it as an “external” symbol from the MLIR point of view (just like you call an external function)

1 Like

Hello,

Sorry for reviving this thread.

Does “fundamentally not possible” mean that it has not been implemented yet or is it that there is a conceptual reason for it to not be possible?

If the latter, is the reason for not allowing symbol tables “inheritance” related to performance / multi-threading issue or is it breaking some kind of invariant?

Thanks