This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Allow SymbolTable to update existing symbols
ClosedPublic

Authored by tpopp on Dec 15 2020, 3:15 PM.

Details

Summary

Previous behavior would fail if inserting an operation that already
existed. Now SymbolTable::insert can also be used as a way to make a
symbol's name unique even after insertion.

Further TODOs have been left over naming and consistent behavior
considerations.

Diff Detail

Event Timeline

tpopp created this revision.Dec 15 2020, 3:15 PM
tpopp requested review of this revision.Dec 15 2020, 3:15 PM
tpopp updated this revision to Diff 312053.Dec 15 2020, 3:19 PM

Correct typo and add comment

rriddle accepted this revision.Dec 15 2020, 3:21 PM

Nice!

mlir/lib/IR/SymbolTable.cpp
155

Can you update the doc here and in the header? It should probably say that it only inserts into the symbol table operation if it isn't already a child.

158

All of this can be wrapped into the if given that it is only useful when inserting the operation.

This revision is now accepted and ready to land.Dec 15 2020, 3:21 PM
This revision was landed with ongoing or failed builds.Dec 15 2020, 3:45 PM
This revision was automatically updated to reflect the committed changes.