[mlir] Add stack alignment to the data layout dialect.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Mon, 3 Apr 2023 06:38:04 +0000 (06:38 +0000)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Mon, 3 Apr 2023 06:58:37 +0000 (06:58 +0000)
commit9d69bca18787e0861c1bc6db8e82d4f21b77ae75
tree19e67ed26913e61943511d044e080f8ced6a44d8
parenta703a9ae33a8cc7e999732791d4d2a592eca3897
[mlir] Add stack alignment to the data layout dialect.

The revision adds the stack alignment to the
data layout dialect and it extends the LLVM dialect
import and export to support the new data layout
entry.

One possible use case for the flag is the LLVM dialect
inliner. The LLVM inliner queries the flag to
determine if it is safe to update the alignment of an
existing alloca. We may want to perform the same
optimization inside of MLIR.

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D147332
14 files changed:
mlir/include/mlir/Dialect/DLTI/DLTI.h
mlir/include/mlir/Dialect/DLTI/DLTIBase.td
mlir/include/mlir/Interfaces/DataLayoutInterfaces.h
mlir/include/mlir/Interfaces/DataLayoutInterfaces.td
mlir/lib/Dialect/DLTI/DLTI.cpp
mlir/lib/Interfaces/DataLayoutInterfaces.cpp
mlir/lib/Target/LLVMIR/DataLayoutImporter.cpp
mlir/lib/Target/LLVMIR/DataLayoutImporter.h
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/test/Dialect/LLVMIR/layout.mlir
mlir/test/Target/LLVMIR/Import/data-layout.ll
mlir/test/Target/LLVMIR/data-layout.mlir
mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp
mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp