This is an archive of the discontinued LLVM Phabricator instance.

[mlir][PDLL] Don't use the result of `Constraint::getDefName()` when uniquing
ClosedPublic

Authored by rriddle on Apr 20 2022, 2:18 AM.

Details

Summary

In the case of anonymous defs this may return the name of the base def class,
which can lead to two different defs with the same name (which hits an assert).
This commit adds a new getUniqueDefName method that returns a unique name
for the constraint.

Diff Detail

Event Timeline

rriddle created this revision.Apr 20 2022, 2:18 AM
Herald added a project: Restricted Project. · View Herald Transcript
rriddle requested review of this revision.Apr 20 2022, 2:18 AM
rriddle updated this revision to Diff 424285.Apr 21 2022, 2:04 PM
jpienaar accepted this revision.Apr 24 2022, 11:42 AM
jpienaar added inline comments.
mlir/lib/Tools/PDLL/ODS/Constraint.cpp
25

Shouldn't this be drop_front?

This revision is now accepted and ready to land.Apr 24 2022, 11:42 AM
rriddle marked an inline comment as done.Apr 26 2022, 2:02 PM
rriddle added inline comments.
mlir/lib/Tools/PDLL/ODS/Constraint.cpp
25

No, the names are usually in the form prettyBaseName(anonymous_...). We want to strip the anonymous stuff off of the end, so we take everything from the front up to the (. The prettyBaseName is what we want to display as the "pretty"/demangled name.

This revision was landed with ongoing or failed builds.Apr 26 2022, 6:34 PM
This revision was automatically updated to reflect the committed changes.
rriddle marked an inline comment as done.