[mlir][SymbolTable] Small optimization to walking symbol references
authorRiver Riddle <riddleriver@gmail.com>
Thu, 29 Oct 2020 05:00:55 +0000 (22:00 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 29 Oct 2020 05:01:10 +0000 (22:01 -0700)
commit73547b08de59d1be0e65d8dbc989e9c186295fcd
tree855a23d2da3b72ce90ea25007644c3cf6c5735e2
parentfa4174792a19072e415ea4ba6e7d91af046817c8
[mlir][SymbolTable] Small optimization to walking symbol references

* Check region count for unknown symbol tables first, as it is a faster check
* Add an accessor to MutableDictionaryAttr to get the internal dictionary without creating a new one if it is empty. This avoids an otherwise unnecessary lookup of an MLIRContext.
mlir/include/mlir/IR/Attributes.h
mlir/lib/IR/SymbolTable.cpp