This is an archive of the discontinued LLVM Phabricator instance.

[mlir][LLVMIR] Fix identified structs with same name
ClosedPublic

Authored by aengelke on Jul 28 2023, 6:17 AM.

Details

Summary

Different identified struct types may have the same name ("").
Previously, these were deduplicated based on their name, which caused
an assertion failure when nesting identified structs:

%0 = type { %1 }
%1 = type { i8 }
declare void @fn(%0)

Diff Detail

Event Timeline

aengelke created this revision.Jul 28 2023, 6:17 AM
Herald added a project: Restricted Project. · View Herald Transcript
aengelke requested review of this revision.Jul 28 2023, 6:17 AM
gysit accepted this revision.Jul 28 2023, 8:00 AM

Thanks for fixing this bug!

LGTM and feel free to implement the file check nit comment if it works.

mlir/test/Target/LLVMIR/Import/global-struct.ll
5

nit: Would the above file check lines work as well? That way it seems a bit clearer the names have to be different.

This revision is now accepted and ready to land.Jul 28 2023, 8:00 AM
This revision was automatically updated to reflect the committed changes.
aengelke marked an inline comment as done.

Thanks for the suggestion, I took it with a minor fix to work around greedy regex matching.