This patch adds the lowering for the Module FlagsAttr to FIR (the OpenMP
dialect component) for the bbc/flang-new tool and compiler.
In addition It ports additional flags from the shared Clang compiler options to
provide this lowering to the OpenMP Dialect.
This patch enables the flags below (and any equals or inverse variants) for
Flang that exist in Clang:
-fopenmp-target-debug
-fopenmp-assume-threads-oversubscription
-fopenmp-assume-teams-oversubscription
-fopenmp-assume-no-nested-parallelism
-fopenmp-assume-no-thread-state
For the bbc tool it only utilises the primary variants to minimize additional
complexity in the tool.
The patch also provides lowering of the FlagsAttr to LLVM-IR,
each individual frontend flag (an argument to the OpenMP MLIR attribute)
is lowered to a global.
In short the patch generates an OpenMP MLIR Dialect FlagsAttr to hold
provided flag information so that it can proliferate down to the translation
to LLVM-IR that occurs in OpenMPToLLVMIRTranslation, allowing use of the
OpenMPIRBuilder to create LLVM-IR globals for the OpenMP runtime to
eventually utilise.
Many of these options have identical flags. While not really needed for this change, it would still be nice to re-organise them a bit. This file could really benefit from some love :) Here's an example of what I have in mind: https://github.com/llvm/llvm-project/blob/cf60d3f1a688671c8eb7859bf0572c403c3c0cca/clang/include/clang/Driver/Options.td#L6575-L6600