This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Implement `DataLayoutTypeInterface` for `LLVMStructType`
ClosedPublic

Authored by zero9178 on Dec 12 2021, 8:04 AM.

Details

Summary

Using this implementation of the interface it is possible to query the size, ABI alignment as well as the preferred alignment of a struct. It should yield the same results as LLVMs llvm::DataLayout on an equivalent llvm::StructType, including for packed structs.

Additionally it is also possible to to increase the ABI and preferred alignment using a data layout entry with the type llvm.struct<()>, which serves the same functionality as the a: component in LLVMs data layout string.

Depends on https://reviews.llvm.org/D115596

Diff Detail