[PATCH] D69785: [OpenMP] Introduce the OpenMP-IR-Builder
Johannes Doerfert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 5 09:33:32 PST 2019
jdoerfert added inline comments.
================
Comment at: clang/include/clang/Driver/Options.td:1643
HelpText<"Emit OpenMP code only for SIMD-based constructs.">;
+def fopenmp_new_codegen : Flag<["-"], "fopenmp-new-codegen">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
+ HelpText<"Use the experimental OpenMP-IR-Builder codegen path.">;
----------------
ABataev wrote:
> Maybe just `-fopenmp-experimental`?
I would prefer the option to be self explanatory but I'm not married to the current name.
================
Comment at: llvm/include/llvm/IR/OpenMPIRBuilder.h:29
+ /// not have an effect on \p M (see initialize).
+ OpenMPIRBuilder(Module &M) : M(M), Builder(M.getContext()) {}
+
----------------
ABataev wrote:
> Do we need a new `Builder` here or we can reuse the one from clang CodeGenFunction?
If you have a "simple" way to do it, we can think about it but I am still unsure if that is actually useful. The clang (=frontend) builder is used for callbacks so user code is build with it either way. We could set up ours here differently if we wish to and I'm a little afraid we would generate some unwanted interactions.
That being said, I tried to reuse the one in clang but struggled *a long time* to make it work. The problem is that it is a templated class with Clang specific template parameters. We would need to make this a template class as well (I think) and that comes with a long tail of problems.
================
Comment at: llvm/include/llvm/IR/OpenMPIRBuilder.h:52
+ /// should be checked and acted upon.
+ void createOMPBarrier(const LocationDescription &Loc, omp::Directive DK,
+ bool CheckCancelFlag = true);
----------------
ABataev wrote:
> Do you really need to spell it as `createOMPBarrier`? Maybe, just `createBarrier` since it is already a member of OMPBuilder.
> Do you really need to spell it as createOMPBarrier? Maybe, just createBarrier since it is already a member of OMPBuilder.
fair point. I will rename if no one objects.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69785/new/
https://reviews.llvm.org/D69785
More information about the cfe-commits
mailing list