Page MenuHomePhabricator

[mlir] Add a new SymbolUserOpInterface class

Authored by rriddle on Oct 15 2020, 4:29 PM.



The initial goal of this interface is to fix the current problems with verifying symbol user operations, but can extend beyond that in the future. The current problems with the verification of symbol uses are:

  • Extremely inefficient:

Most current symbol users perform the symbol lookup using the slow O(N) string compare methods, which can lead to extremely long verification times in large modules.

  • Invalid/break the constraints of verification pass

If the symbol reference is not-flat(and even if it is flat in some cases) a verifier for an operation is not permitted to touch the referenced operation because it may be in the process of being mutated by a different thread within the pass manager.

The new SymbolUserOpInterface exposes a method verifySymbolUses that will be invoked from the parent symbol table to allow for verifying the constraints of any referenced symbols. This method is passed a SymbolTableCollection to allow for O(1) lookups of any necessary symbol operation.

Depends On D89505

Diff Detail

Event Timeline

rriddle created this revision.Oct 15 2020, 4:29 PM
rriddle requested review of this revision.Oct 15 2020, 4:29 PM
jpienaar accepted this revision.Oct 15 2020, 4:59 PM
This revision is now accepted and ready to land.Oct 15 2020, 4:59 PM
This revision was automatically updated to reflect the committed changes.