llvm-project/flang/tools
Sergio Afonso 0e9523efda [mlir] Support lowering of dialect attributes attached to top-level modules
This patch supports the processing of dialect attributes attached to top-level
module-type operations during MLIR-to-LLVMIR lowering.

This approach modifies the `mlir::translateModuleToLLVMIR()` function to call
`ModuleTranslation::convertOperation()` on the top-level operation, after its
body has been lowered. This, in turn, will get the
`LLVMTranslationDialectInterface` object associated to that operation's dialect
before trying to use it for lowering prior to processing dialect attributes
attached to the operation.

Since there are no `LLVMTranslationDialectInterface`s for the builtin and GPU
dialects, which define their own module-type operations, this patch also adds
and registers them. The requirement for always calling
`mlir::registerBuiltinDialectTranslation()` before any translation of MLIR to
LLVM IR where builtin module operations are present is introduced. The purpose
of these new translation interfaces is to succeed when processing module-type
operations, allowing the lowering process to continue and to prevent the
introduction of failures related to not finding such interfaces.

Differential Revision: https://reviews.llvm.org/D145932
2023-03-21 12:54:26 +00:00
..
bbc Break circular dependency between FIR dialect and utilities 2023-03-09 15:24:51 -08:00
f18 [Flang] Add PowerPC intrinsics 2023-02-18 11:56:03 -05:00
f18-parse-demo
fir-opt
flang-driver [NFC][TargetParser] Replace uses of llvm/Support/Host.h 2023-02-10 09:59:46 +00:00
tco [mlir] Support lowering of dialect attributes attached to top-level modules 2023-03-21 12:54:26 +00:00
.clang-tidy
CMakeLists.txt