4 Commits

Author SHA1 Message Date
Oleksandr "Alex" Zinenko
9519e3ecbf
[mlir] support dialect attribute translation to LLVM IR (#75309)
Extend the `amendOperation` mechanism for translating dialect attributes
attached to operations from another dialect when translating MLIR to
LLVM IR. Previously, this mechanism would have no knowledge of the LLVM
IR instructions created for the given operation, making it impossible
for it to perform local modifications such as attaching operation-level
metadata. Collect instructions inserted by the LLVM IR builder and pass
them to `amendOperation`.
2023-12-19 14:18:16 +01:00
Sergio Afonso
2ae5d1c790
Revert "Revert "[MLIR] Move builtin.module LLVM IR translation to before nested operations""
This reverts commit 823151f0cfc8f031bcecb15c8246b5649e87b31a.
2023-09-04 11:35:59 +01:00
Sergio Afonso
823151f0cf
Revert "[MLIR] Move builtin.module LLVM IR translation to before nested operations"
This reverts commit 0b8c636211b89ba721f060d30290e8a1992879b7.
2023-09-01 18:10:56 +01:00
Sergio Afonso
0b8c636211
[MLIR] Move builtin.module LLVM IR translation to before nested operations
This patch moves the call for translating an MLIR module to LLVM IR to the
beginning of the translation process. This enables the use of dialect
attributes attached to `builtin.module` operations and the `amendOperation()`
flow to initialize dialect-specific global configuration before translating
the contents of the module.

Currently, this patch does not impact the generated IR on its own. Testing
infrastructure to allow translating the Test dialect to LLVM IR is added, so
that it can be checked that the current behavior is not broken in the future.

Differential Revision: https://reviews.llvm.org/D158278
2023-09-01 17:09:25 +01:00