This is an archive of the discontinued LLVM Phabricator instance.

[mlir][LLVM] Fix `DataLayoutTypeInterface` for opqaue pointers with non-default address space
ClosedPublic

Authored by zero9178 on Apr 22 2022, 11:46 AM.

Details

Summary

As a fallback mechanism, if no entry was supplied for a given address space, the size or alignment for a pointer type with the default address space is returned instead.
This code currently crashes with opaque pointers, as it tries to construct a typed pointer type from the opaque pointer type, leading to a null pointer dereference when fetching the element type.

This patch fixes the issue by handling the opaque pointer cases explicitly.

Diff Detail

Event Timeline

zero9178 created this revision.Apr 22 2022, 11:46 AM
zero9178 requested review of this revision.Apr 22 2022, 11:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 11:46 AM
ftynse accepted this revision.Apr 22 2022, 2:31 PM
This revision is now accepted and ready to land.Apr 22 2022, 2:31 PM