[MLIR][LLVM] Add accessor for LLVMModule and invoke convertDialectAttributes on GlobalOps
authorAndrew Gozillon <Andrew.Gozillon@amd.com>
Thu, 27 Apr 2023 19:44:19 +0000 (14:44 -0500)
committerAndrew Gozillon <Andrew.Gozillon@amd.com>
Thu, 27 Apr 2023 19:51:54 +0000 (14:51 -0500)
commitf478721231bdb71ba8f0f6fb21673b9b7f652add
tree12ce05954d81a0ffa798bd1df8e108f49cde3808
parentc67079f1be713fa558b3773562bd1eeb156cadbd
[MLIR][LLVM] Add accessor for LLVMModule and invoke convertDialectAttributes on GlobalOps

This patch seeks to do two things add an accessor method to
retrieve the ModuleTranslations contained LLVM Module for direct
usage by dialects that are being lowered to LLVM-IR. One particular
use case for this is in the OpenMP Dialect, when interfacing
with the OMPIRBuilder in certain cases it is useful to be able
to access the LLVM Module directly.

The second is invoking convertDialectAttributes on GlobalOp's
so as to be able to lower dialect specific attributes that are
applied or lowered onto GlobalOp's.

Reviewers: ftynse

Differential Revision: https://reviews.llvm.org/D149279
mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp