This patch seeks to add a convertModuleOperation function which allows
dialect specific module operation lowering to LLVM-IR (the operation
itself, not its body and for a dialect module, e.g. an OpenMP module
such as omp.module). It also allows amendOperation to be invoked on
module attributes for builtin and specialised modules, allowing
dialect specific attribute lowering, e.g. I add an omp.is_device flag,
which can now have specialised lowering to LLVM IR.
To give some context, I have currently found use for this in the
OpenMPIRToLLVMTranslation lowering segment (utilised in the
Flang compiler). It allows the ability to hook into module attributes
that are specific to the OpenMP Dialect that need lowering using
the OpenMPIRBuilder that is shared between Clang/Flang. I have
previously tested it with an OpenMP specific module.
Although, I am aiming to upstream the former, rather than the
latter if this is the correct approach. I have an external patch
that I can link to which I am trying to upstream in components,
if that helps to give more context.