[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-30 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. Oh, sorry. You merged all of my patch, right? It was not ready and even now it is unclear if the representation change in my patch is good or not. I was trying to suggest you only take the InternalOMPIRBuilder stuff so you can avoid the static function, not all of my

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-30 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D80222#2065141 , @jdoerfert wrote: > Initialize the internal OpenMPIRbuilder (see my patch). Isn't it initialized on line 1063 in `CGOpenMPRuntime.cpp`? There weren't any conflicts listed there when I merged your patch so it

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-30 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. Initialize the internal OpenMPIRbuilder (see my patch). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80222/new/ https://reviews.llvm.org/D80222 ___ cfe-commits mailing list

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D80222#2061810 , @jdoerfert wrote: > LGTM. Thanks for taking this one, it was more complex than I thought but it > is a really nice step in the right direction. I'll commit it for you soon if > you don't have access yet. Feel

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-28 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert accepted this revision. jdoerfert added a comment. This revision is now accepted and ready to land. LGTM. Thanks for taking this one, it was more complex than I thought but it is a really nice step in the right direction. I'll commit it for you soon if you don't have access yet. Feel

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-28 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. I figured out what the problem is and we can relatively easily fix it *once* we always have an OpenMPIRBuilder available in Clangs CG. As noted in D80735 , we should remove `IdentQTy` as it is used to create a new ident_t in some

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added a comment. Yes, this passed all the tests on my machine at least. Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:124 + return {FnTy, Fn}; +} } jdoerfert wrote: > Are you sure we need to

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-28 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. This passes all the tests? I think we should go with it and investigate the cast thing later. Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:124 + return {FnTy, Fn}; +} } Are you sure we need to do the cast here?

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D80222#2060420 , @jdoerfert wrote: > Take a look at D80735 , it works fine for me > locally. Is that what you did? What problems do you observe now? That's pretty much what I did. If I kept

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-28 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. Take a look at D80735 , it works fine for me locally. Is that what you did? What problems do you observe now? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80222/new/

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) { jhuber6

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-27 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) { jdoerfert

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-27 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) { jhuber6 wrote: > jdoerfert wrote: > > jhuber6

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-27 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) { jdoerfert

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-27 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) { jhuber6 wrote: > jdoerfert wrote: > > jhuber6

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-27 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) { jdoerfert

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-27 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) { jhuber6 wrote: > AndreyChurbanov wrote: > >

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-27 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) {

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-27 Thread Andrey Churbanov via Phabricator via cfe-commits
AndreyChurbanov added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) { jhuber6 wrote: > jhuber6 wrote: > >

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-27 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added inline comments. Comment at: openmp/runtime/test/tasking/kmp_taskloop.c:100 th_counter[i] = 0; -#pragma omp parallel num_threads(N) +#pragma omp parallel // num_threads(N) { jhuber6

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked 3 inline comments as done. jhuber6 added inline comments. Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:250 +__OMP_SIZE_TYPE(SizeTy) +#undef __OMP_SIZE_TYPE + jdoerfert wrote: > Why the indirection via `__OMP_SIZE_TYPE`? Wouldn't

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-26 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:250 +__OMP_SIZE_TYPE(SizeTy) +#undef __OMP_SIZE_TYPE + Why the indirection via `__OMP_SIZE_TYPE`? Wouldn't `OMP_TYPE(SizeTy, M.getDataLayout().getIntPtrType(Ctx))`

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked 2 inline comments as done. jhuber6 added inline comments. Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:245 +__OMP_PTR_TYPE(Int8PtrPtr, Int8Ptr) +__OMP_PTR_TYPE(Int8PtrPtrPtr, Int8PtrPtr) + I added these types as @fghanim suggested.

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-26 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. In D80222#2055149 , @jhuber6 wrote: > This passes all checks except the libomp ones. Those still seg-fault, I'm not > entirely sure why. Cuda failure is again because I don't have it configured > on my machine. > > Failing

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-22 Thread Fady Ghanim via Phabricator via cfe-commits
fghanim added inline comments. Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:244 -// TODO: Replace this with the real size_t type -#define __OMP_SIZE_TYPE(NAME) OMP_TYPE(NAME, Type::getInt64Ty(Ctx)) +#define __OMP_SIZE_TYPE(NAME) OMP_TYPE(NAME,

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added inline comments. Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:244 -// TODO: Replace this with the real size_t type -#define __OMP_SIZE_TYPE(NAME) OMP_TYPE(NAME, Type::getInt64Ty(Ctx)) +#define

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-21 Thread Fady Ghanim via Phabricator via cfe-commits
fghanim added inline comments. Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:244 -// TODO: Replace this with the real size_t type -#define __OMP_SIZE_TYPE(NAME) OMP_TYPE(NAME, Type::getInt64Ty(Ctx)) +#define __OMP_SIZE_TYPE(NAME) OMP_TYPE(NAME,

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-21 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a subscriber: fghanim. jdoerfert added inline comments. Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:244 -// TODO: Replace this with the real size_t type -#define __OMP_SIZE_TYPE(NAME) OMP_TYPE(NAME, Type::getInt64Ty(Ctx)) +#define

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-21 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked 2 inline comments as done. jhuber6 added inline comments. Comment at: llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h:203 + static Function *getOrCreateRuntimeFunction(Module , + omp::RuntimeFunction FnID);

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-21 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. > libomp used to pass until I changed it to us getOrCreateRuntimeFunction I > think. Those tests are flaky, I think. Just run them a few times. I don't expect this to influence them at all. Comment at:

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-21 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added inline comments. Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:483 +__OMP_RTL(__kmpc_push_num_teams, false, /* Void? */ Int32, IdentPtr, Int32, + Int32, Int32) For this one there's

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-20 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked 3 inline comments as done. jhuber6 added a comment. Here's the tests it fails, there might be a few that are wrong for reasons beyond the size_t stuff but it's hard to tell until that issue is resolved. The cuda test is just because I have CUDA set up incorrectly on my machine,

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-20 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. We pass all clang tests, right? Comment at: llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h:203 + static Function *getOrCreateRuntimeFunction(Module , + omp::RuntimeFunction FnID);

[PATCH] D80222: Replace Clang's createRuntimeFunction with the definitions in OMPKinds.def

2020-05-19 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added a reviewer: jdoerfert. jhuber6 added projects: OpenMP, clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits, sstefan1. jhuber6 edited the summary of this revision. This patch changes Clang to generate runtime functions from the information