This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Optimize symbol related checks in SymbolDCE
ClosedPublic

Authored by rriddle on Oct 15 2020, 3:23 PM.

Details

Summary

This revision contains two optimizations related to symbol checking:

  • Optimize SymbolOpInterface to only check for a name attribute if the operation is an optional symbol.

This removes an otherwise unnecessary attribute lookup from a majority of symbols.

  • Add a new SymbolTableCollection class to represent a collection of SymbolTables.

This allows for perfoming non-flat symbol lookups in O(1) time by caching SymbolTables for symbol table operations. This class is very useful for algorithms that operate on multiple symbol tables, either recursively or not.

Depends On D89504

Diff Detail

Event Timeline

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