This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Avoid needlessly converting LLVM named structs with compatible elements
ClosedPublic

Authored by ftynse on Dec 3 2021, 4:14 AM.

Details

Summary

Conversion of LLVM named structs leads to them being renamed since we cannot
modify the body of the struct type once it is set. Previously, this applied to
all named struct types, even if their element types were not affected by the
conversion. Make this behvaior only applicable when element types are changed.
This requires making the LLVM dialect type-compatibility check recursively look
at the element types (arguably, it should have been doing than since the moment
the LLVM dialect type system stopped being closed). In addition, have a more
lax check for outer types only to avoid repeated check when necessary (e.g.,
parser, verifiers that are going to also look at the inner type).

Diff Detail

Event Timeline

ftynse created this revision.Dec 3 2021, 4:14 AM
ftynse requested review of this revision.Dec 3 2021, 4:14 AM
wsmoses accepted this revision.Dec 3 2021, 1:43 PM
wsmoses added inline comments.
mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
1

Why this deletion?

This revision is now accepted and ready to land.Dec 3 2021, 1:43 PM