This patch changes Clang to generate runtime functions from the information inside OMPKinds.def and to use the enumeration values in OMPConstants. Testing currently fails because of incomplete type support for 32 and 64 bit targets.
Details
Diff Detail
Event Timeline
Changed CGOpenMPRuntime to use the getOrCreateRuntimeFunction method in OpenMPIRBuilder. Also changed the type signature for kmpc_critical_with_hint to Int32Ty.
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, libomp used to pass until I changed it to us getOrCreateRuntimeFunction I think.
Clang :: Driver/cuda-simple.cu Clang :: OpenMP/barrier_codegen.cpp Clang :: OpenMP/distribute_parallel_for_reduction_codegen.cpp Clang :: OpenMP/distribute_parallel_for_reduction_task_codegen.cpp Clang :: OpenMP/for_reduction_task_codegen.cpp Clang :: OpenMP/nvptx_target_parallel_reduction_codegen.cpp Clang :: OpenMP/nvptx_teams_reduction_codegen.cpp Clang :: OpenMP/openmp_win_codegen.cpp Clang :: OpenMP/parallel_firstprivate_codegen.cpp Clang :: OpenMP/parallel_for_reduction_task_codegen.cpp Clang :: OpenMP/parallel_master_reduction_task_codegen.cpp Clang :: OpenMP/parallel_reduction_task_codegen.cpp Clang :: OpenMP/parallel_sections_reduction_task_codegen.cpp Clang :: OpenMP/sections_reduction_task_codegen.cpp Clang :: OpenMP/target_depend_codegen.cpp Clang :: OpenMP/target_enter_data_depend_codegen.cpp Clang :: OpenMP/target_exit_data_depend_codegen.cpp Clang :: OpenMP/target_parallel_depend_codegen.cpp Clang :: OpenMP/target_parallel_for_depend_codegen.cpp Clang :: OpenMP/target_parallel_for_reduction_task_codegen.cpp Clang :: OpenMP/target_parallel_for_simd_depend_codegen.cpp Clang :: OpenMP/target_parallel_reduction_task_codegen.cpp Clang :: OpenMP/target_simd_depend_codegen.cpp Clang :: OpenMP/target_teams_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_reduction_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_reduction_task_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_reduction_codegen.cpp Clang :: OpenMP/target_teams_distribute_reduction_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_reduction_codegen.cpp Clang :: OpenMP/target_teams_map_codegen.cpp Clang :: OpenMP/target_update_depend_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_reduction_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_reduction_task_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_reduction_codegen.cpp Clang :: OpenMP/teams_distribute_reduction_codegen.cpp Clang :: OpenMP/teams_distribute_simd_reduction_codegen.cpp libomp :: tasking/kmp_taskloop.c libomp :: worksharing/for/kmp_doacross_check.c
llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h | ||
---|---|---|
203 | The OpenMPIRBuilder struct has a Module named M so I wasn't sure if I should be shadowing it. | |
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
370 | That's just where I was unsure because I saw some conflicting information, like this one with Int32 in the runtime and uintptr_t in Clang. | |
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
103 | Don't know why I didn't think of doing that, will do. |
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
---|---|---|
483 | For this one there's conflicting information on the return value. Clang expects this in its checks But when I look at the runtime I find this kmp_int32 num_teams, kmp_int32 num_threads) { |
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.
llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h | ||
---|---|---|
203 | Go with M, it's static :) | |
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
483 | Make it void here please, will need to update the tests: | |
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
103 | And if the callback is the same for both, merge the conditionals. |
Making suggested changes. I added a quick implementation of size_t by getting the target triple data from the Module we have access to in the initializeTypes function, I'm not sure if this works in all situations. After changing the implementation some of the tests are invalidated and will need to be changed. push_num_teams was changed to void so now the tests that assign a register to the return value will fail. Additionally this applies the function attributes so some of the tests will check for not having function attributes. There are still tests that cause it to segfault, I think it might be related to OpenMP 5.0 because it's listed in the arguments. I just wanted to get this up for some feedback before rewriting the tests. Here's the tests that failed, the ones involving teams were mostly related to changing push_num_teams to void, the others are seg faults.
Clang :: Driver/cuda-simple.cu Clang :: OpenMP/barrier_codegen.cpp Clang :: OpenMP/distribute_parallel_for_reduction_task_codegen.cpp Clang :: OpenMP/for_reduction_task_codegen.cpp Clang :: OpenMP/openmp_win_codegen.cpp Clang :: OpenMP/parallel_for_reduction_task_codegen.cpp Clang :: OpenMP/parallel_master_reduction_task_codegen.cpp Clang :: OpenMP/parallel_reduction_task_codegen.cpp Clang :: OpenMP/parallel_sections_reduction_task_codegen.cpp Clang :: OpenMP/sections_reduction_task_codegen.cpp Clang :: OpenMP/target_parallel_for_reduction_task_codegen.cpp Clang :: OpenMP/target_parallel_reduction_task_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_reduction_task_codegen.cpp Clang :: OpenMP/teams_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_reduction_task_codegen.cpp
llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h | ||
---|---|---|
203 | Forgot to write the file when I changed it here, not work updating the diff for a single character. I'll put it in the next one. | |
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
245 | I'm just directly getting the SizeTy from the Module, I'm not sure if this is a permanent solution. |
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
---|---|---|
245 | Agreed. But to avoid conflict with patch D79675, let this change go in a separate patch after that. This way, we can also do some clean ups related to this, and add Int8PtrPtr, Int8PtrPtrPtr, and any other typing issues, without delaying patch D79675 any further - I am done with that patch, and made my final changes a couple of days ago. Nit: Also, I saw below that some formatting was done. Wouldn't it be better if formatting/comments related to changes in D79739, are handled as part of that patch? |
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
---|---|---|
245 | Doesn't this patch already support Int8PtrPtrPtr? It's the same thing as a VoidPtrPtrPtr which I have defined above here. |
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
---|---|---|
245 | You are correct. But think of it in the same way we have voidptr and int8ptr, even though they are the same. |
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 Tests (3):
Clang :: Driver/cuda-simple.cu libomp :: tasking/kmp_taskloop.c libomp :: worksharing/for/kmp_doacross_check.c
I believe libomp tests are not related to this but you should double check. run them locally without this patch maybe
Fixed the issue with the libomp tests and now pass every test. I combined this patch with D79739 so that patch is now obsolete.
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
---|---|---|
245 | I added these types as @fghanim suggested. | |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
100 ↗ | (On Diff #266325) | I am not entirely sure why, but commenting this out causes the problem to go away. I tried adding proper names to the forward-declared functions but since clang already knew I had something called ident_t, I couldn't declare a new struct with the same name. |
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
---|---|---|
250 | Why the indirection via __OMP_SIZE_TYPE? Wouldn't OMP_TYPE(SizeTy, M.getDataLayout().getIntPtrType(Ctx)) suffice? | |
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
136 | I now think we either put the stuff in #ifndef NDEBUG or move the FnTy = into the first switch that does the lookup. | |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
100 ↗ | (On Diff #266325) | This is not good. The difference should only be that the kmpc_fork_call has a different argument, right? Does the segfault happen at compile or runtime? You can just use the ident_t clang created, right? Did you print the function names requested by clang as we discussed? |
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | ||
---|---|---|
250 | I think I did it just to make it more explicit while it was temporary, but now that we're defining it here there's no point, I'll change it. | |
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
136 | Yeah, I was wondering about the cost of the extra lookup. But we could definitely just get the type when we look up the function and just do a comparison in this branch. | |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
100 ↗ | (On Diff #266325) | I added an assertion and debug statements. If I try to declare a struct named "Ident_t" I get the following error message in the seg-fault. I think the seg-fault is compile-time. Found OpenMP runtime function __kmpc_global_thread_num with type i32 (%struct.ident_t.0*). Expected type is i32 (%struct.ident_t*) |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) | I'm not sure if there's a way around this without changing the getOrCreateRuntimeFunction method to return a FunctionCallee and removing the assertion. Clang doesn't know about the ident_t struct when it's compiling the file, but when its doing the codegen it sees two structs with the same name and creates a new name. So when it gets the types it says that ident_t and ident_t.0 don't match. As you said the old version got around this by adding a bitcasting instruction so it knew how to turn it into an ident_t pointer. |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) | Note that this change breaks the test on any system with more that 4 procs. Because array th_counter[4] is indexed by thread number which can easily be greater than 3 if number of threads is not limited. |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) | The problem was that the num_threads clause required an implicit call to kmpc_global_thread_num so it could be passed to kmpc_push_num_threads. The types of the implicit function and the forward declaration then wouldn't match up. I added another forward declaration to explicitly call kmpc_push_num_threads. Is this a sufficient solution? |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) | We need this to work with num_threads(8).
Where are the two structs coming from? We should have one. If clang introduces one it needs to use the one from OMPKindes.def instead. Is that a fix? |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) | The first struct is the one that I'm assuming comes from the OpenMP CodeGen that places the Ident_t struct in the IR file. if I declare a struct also named ident_t in the C source file it most likely will see that there's two structs with the same name and call the second one "ident_t.0" internally. The other ident_t struct is only known once clang generates the LLVM IR so I can't just use "ident_t" nor can I declare a struct with the same name. |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) |
|
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) |
I'm probably not understanding something correctly here. There's already an ident_t type declared in CGOpenMPRuntime:1065 which it uses for generating the types for the runtime functions, but this isn't used until code generation so it can't be used while compiling the file. If we declare it up front then wouldn't that make ident_t a reserved keyword?
A FunctionCallee can be generated from a Function * but not vice-versa, right? This would require changing the code in OpenMPIRBuilder. |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) | In CGOpenMPRuntime.cpp there is: FunctionCallee is just a Function* and the "expected type". You can go from FunctionCallee to Function by just picking the proper member. You'd need to change the Builder in two ways: 1) return FunctionCallee(Fn, ExpectedType); 2) where it is used extract the Function * from the FunctionCallee. You might want to use a helper if you go this route. |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) | It causes all the OpenMP tests to fail, not sure why exactly. I'll look into it more tomorrow. |
openmp/runtime/test/tasking/kmp_taskloop.c | ||
---|---|---|
100 ↗ | (On Diff #266325) | I'm not exactly sure why, but if you move the llvm::omp::types:InitializeTypes(CGM.getModule()) statement before where IdenTy is assigned it causes some of the tests to fail without changing anything else. Any clue why? Instead I changed llvm::Type *CGOpenMPRuntime::getIdentTyPointerTy() in CGOpenMPRuntime:1594 to return llvm::omp::types::Ident->getPointerTo() which is the only place IdentTy is used. But it has the same problem. |
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 in the old Ident declaration, but didn't use it and returned llvm::omp::types::IdentPtr from that function it would work. But the compiler would segfault if I removed it. It still failed the two problematic tests. I have a patch that changes the function to return a FunctionCallee and does a bitcast on the function if the types don't match. That passed the tests but it would be beneficial if we could get it to work without needing to change it.
Changed getOrCreateRuntimeFunction to return a FunctionCallee instead of a Function*. Added a helper function inside of OpenMPIRBuilder to get the Function*. Added conditional bitcast to change the types if they do not match. This was done inside of CGM.createRuntimeFunction if it found an existing declaration and the types didn't match. Maybe be able to change this back to just return a Function*
This passes all the tests? I think we should go with it and investigate the cast thing later.
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
---|---|---|
125 | here we probably want to cast the result if we don't do it above. Just do the getBitCast, it should be a no-op if there is nothing to cast. | |
136 | Are you sure we need to do the cast here? I thought clang will create it when it creates calls based of FunctionCallee objects. That was, to my understanding, the idea of the FunctionCallee thing. We might be able to just return {FnTy, Fn} here. If not we could always cast and return, as you noted a function *. Internally, only the expected type makes any sense, everything else will not be handled gracefully. |
Yes, this passed all the tests on my machine at least.
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
---|---|---|
136 | I tried it without and the same problem occured. The old method used CGM.createRuntimeFunction which internally has a cast like this one. |
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 situations. The entire getOrCreateDefaultLocation in clangs CG, should be replaced by OpenMPIRBuilder::getOrCreateIdent. We do this later.
This passed all tests on my machine. I changed the bitcast to always try to cast the types. Let me know if you think there's anything else I should change because I think this might be good to go.
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 free to get access though.
Merging patch with origin and D80735. This now fails a lot of the tests after the merge. I had a previous branch that was merging it with origin after some new functions were added to CGOpenMPRuntime.cpp that only failed libomp/declare_mapper_api.cpp with a segfault. I'll keep looking into it.
Failing Tests (238):
Clang :: Driver/cuda-simple.cu Clang :: Headers/nvptx_device_cmath_functions.c Clang :: Headers/nvptx_device_cmath_functions.cpp Clang :: Headers/nvptx_device_cmath_functions_cxx17.cpp Clang :: Headers/nvptx_device_math_complex.c Clang :: Headers/nvptx_device_math_functions.c Clang :: Headers/nvptx_device_math_functions.cpp Clang :: Headers/nvptx_device_math_functions_cxx17.cpp Clang :: Headers/nvptx_device_math_modf.cpp Clang :: Headers/nvptx_device_math_sin.c Clang :: Headers/nvptx_device_math_sin.cpp Clang :: Headers/nvptx_device_math_sin_cos.cpp Clang :: Headers/nvptx_device_math_sincos.cpp Clang :: OpenMP/amdgcn_device_function_call.cpp Clang :: OpenMP/capturing_in_templates.cpp Clang :: OpenMP/declare_mapper_codegen.cpp Clang :: OpenMP/declare_target_codegen.cpp Clang :: OpenMP/declare_target_codegen_globalization.cpp Clang :: OpenMP/declare_target_link_codegen.cpp Clang :: OpenMP/declare_variant_mixed_codegen.c Clang :: OpenMP/distribute_codegen.cpp Clang :: OpenMP/distribute_firstprivate_codegen.cpp Clang :: OpenMP/distribute_lastprivate_codegen.cpp Clang :: OpenMP/distribute_parallel_for_codegen.cpp Clang :: OpenMP/distribute_parallel_for_firstprivate_codegen.cpp Clang :: OpenMP/distribute_parallel_for_if_codegen.cpp Clang :: OpenMP/distribute_parallel_for_lastprivate_codegen.cpp Clang :: OpenMP/distribute_parallel_for_num_threads_codegen.cpp Clang :: OpenMP/distribute_parallel_for_private_codegen.cpp Clang :: OpenMP/distribute_parallel_for_proc_bind_codegen.cpp Clang :: OpenMP/distribute_parallel_for_reduction_codegen.cpp Clang :: OpenMP/distribute_parallel_for_simd_codegen.cpp Clang :: OpenMP/distribute_parallel_for_simd_firstprivate_codegen.cpp Clang :: OpenMP/distribute_parallel_for_simd_if_codegen.cpp Clang :: OpenMP/distribute_parallel_for_simd_lastprivate_codegen.cpp Clang :: OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp Clang :: OpenMP/distribute_parallel_for_simd_private_codegen.cpp Clang :: OpenMP/distribute_parallel_for_simd_proc_bind_codegen.cpp Clang :: OpenMP/distribute_private_codegen.cpp Clang :: OpenMP/distribute_simd_codegen.cpp Clang :: OpenMP/distribute_simd_firstprivate_codegen.cpp Clang :: OpenMP/distribute_simd_lastprivate_codegen.cpp Clang :: OpenMP/distribute_simd_private_codegen.cpp Clang :: OpenMP/distribute_simd_reduction_codegen.cpp Clang :: OpenMP/is_initial_device.c Clang :: OpenMP/nvptx_SPMD_codegen.cpp Clang :: OpenMP/nvptx_data_sharing.cpp Clang :: OpenMP/nvptx_declare_target_var_ctor_dtor_codegen.cpp Clang :: OpenMP/nvptx_declare_variant_device_kind_codegen.cpp Clang :: OpenMP/nvptx_declare_variant_implementation_vendor_codegen.cpp Clang :: OpenMP/nvptx_distribute_parallel_generic_mode_codegen.cpp Clang :: OpenMP/nvptx_force_full_runtime_SPMD_codegen.cpp Clang :: OpenMP/nvptx_lambda_capturing.cpp Clang :: OpenMP/nvptx_lambda_pointer_capturing.cpp Clang :: OpenMP/nvptx_parallel_codegen.cpp Clang :: OpenMP/nvptx_parallel_for_codegen.cpp Clang :: OpenMP/nvptx_param_translate.c Clang :: OpenMP/nvptx_target_codegen.cpp Clang :: OpenMP/nvptx_target_cuda_mode_messages.cpp Clang :: OpenMP/nvptx_target_exceptions_messages.cpp Clang :: OpenMP/nvptx_target_firstprivate_codegen.cpp Clang :: OpenMP/nvptx_target_parallel_codegen.cpp Clang :: OpenMP/nvptx_target_parallel_num_threads_codegen.cpp Clang :: OpenMP/nvptx_target_parallel_proc_bind_codegen.cpp Clang :: OpenMP/nvptx_target_parallel_reduction_codegen.cpp Clang :: OpenMP/nvptx_target_printf_codegen.c Clang :: OpenMP/nvptx_target_pure_deleted_codegen.cpp Clang :: OpenMP/nvptx_target_requires_unified_shared_memory.cpp Clang :: OpenMP/nvptx_target_simd_codegen.cpp Clang :: OpenMP/nvptx_target_teams_codegen.cpp Clang :: OpenMP/nvptx_target_teams_distribute_codegen.cpp Clang :: OpenMP/nvptx_target_teams_distribute_parallel_for_codegen.cpp Clang :: OpenMP/nvptx_target_teams_distribute_parallel_for_generic_mode_codegen.cpp Clang :: OpenMP/nvptx_target_teams_distribute_parallel_for_simd_codegen.cpp Clang :: OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp Clang :: OpenMP/nvptx_teams_codegen.cpp Clang :: OpenMP/nvptx_teams_reduction_codegen.cpp Clang :: OpenMP/nvptx_unsupported_type_messages.cpp Clang :: OpenMP/openmp_offload_codegen.cpp Clang :: OpenMP/openmp_offload_registration.cpp Clang :: OpenMP/parallel_codegen.cpp Clang :: OpenMP/parallel_master_codegen.cpp Clang :: OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp Clang :: OpenMP/target_codegen.cpp Clang :: OpenMP/target_codegen_global_capture.cpp Clang :: OpenMP/target_codegen_registration.cpp Clang :: OpenMP/target_codegen_registration_naming.cpp Clang :: OpenMP/target_constant_device_codegen.cpp Clang :: OpenMP/target_defaultmap_codegen.cpp Clang :: OpenMP/target_depend_codegen.cpp Clang :: OpenMP/target_device_codegen.cpp Clang :: OpenMP/target_firstprivate_codegen.cpp Clang :: OpenMP/target_is_device_ptr_codegen.cpp Clang :: OpenMP/target_map_codegen.cpp Clang :: OpenMP/target_messages.cpp Clang :: OpenMP/target_parallel_codegen.cpp Clang :: OpenMP/target_parallel_codegen_registration.cpp Clang :: OpenMP/target_parallel_codegen_registration_naming.cpp Clang :: OpenMP/target_parallel_debug_codegen.cpp Clang :: OpenMP/target_parallel_depend_codegen.cpp Clang :: OpenMP/target_parallel_for_codegen.cpp Clang :: OpenMP/target_parallel_for_codegen_registration.cpp Clang :: OpenMP/target_parallel_for_codegen_registration_naming.cpp Clang :: OpenMP/target_parallel_for_debug_codegen.cpp Clang :: OpenMP/target_parallel_for_depend_codegen.cpp Clang :: OpenMP/target_parallel_for_simd_codegen.cpp Clang :: OpenMP/target_parallel_for_simd_codegen_registration.cpp Clang :: OpenMP/target_parallel_for_simd_codegen_registration_naming.cpp Clang :: OpenMP/target_parallel_for_simd_depend_codegen.cpp Clang :: OpenMP/target_parallel_for_simd_uses_allocators_codegen.cpp Clang :: OpenMP/target_parallel_for_uses_allocators_codegen.cpp Clang :: OpenMP/target_parallel_if_codegen.cpp Clang :: OpenMP/target_parallel_no_exceptions.cpp Clang :: OpenMP/target_parallel_num_threads_codegen.cpp Clang :: OpenMP/target_parallel_uses_allocators_codegen.cpp Clang :: OpenMP/target_private_codegen.cpp Clang :: OpenMP/target_reduction_codegen.cpp Clang :: OpenMP/target_simd_codegen.cpp Clang :: OpenMP/target_simd_codegen_registration.cpp Clang :: OpenMP/target_simd_codegen_registration_naming.cpp Clang :: OpenMP/target_simd_depend_codegen.cpp Clang :: OpenMP/target_simd_uses_allocators_codegen.cpp Clang :: OpenMP/target_teams_codegen.cpp Clang :: OpenMP/target_teams_codegen_registration.cpp Clang :: OpenMP/target_teams_codegen_registration_naming.cpp Clang :: OpenMP/target_teams_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_codegen.cpp Clang :: OpenMP/target_teams_distribute_codegen_registration.cpp Clang :: OpenMP/target_teams_distribute_codegen_registration_naming.cpp Clang :: OpenMP/target_teams_distribute_collapse_codegen.cpp Clang :: OpenMP/target_teams_distribute_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_dist_schedule_codegen.cpp Clang :: OpenMP/target_teams_distribute_firstprivate_codegen.cpp Clang :: OpenMP/target_teams_distribute_lastprivate_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_collapse_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_dist_schedule_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_firstprivate_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_if_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_lastprivate_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_order_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_private_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_proc_bind_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_reduction_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_schedule_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration_naming.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_collapse_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_dist_schedule_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_private_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_proc_bind_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_reduction_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_schedule_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_simd_uses_allocators_codegen.cpp Clang :: OpenMP/target_teams_distribute_parallel_for_uses_allocators_codegen.cpp Clang :: OpenMP/target_teams_distribute_private_codegen.cpp Clang :: OpenMP/target_teams_distribute_reduction_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_codegen_registration.cpp Clang :: OpenMP/target_teams_distribute_simd_codegen_registration_naming.cpp Clang :: OpenMP/target_teams_distribute_simd_collapse_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_depend_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_dist_schedule_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_firstprivate_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_lastprivate_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_private_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_reduction_codegen.cpp Clang :: OpenMP/target_teams_distribute_simd_uses_allocators_codegen.cpp Clang :: OpenMP/target_teams_distribute_uses_allocators_codegen.cpp Clang :: OpenMP/target_teams_map_codegen.cpp Clang :: OpenMP/target_teams_num_teams_codegen.cpp Clang :: OpenMP/target_teams_thread_limit_codegen.cpp Clang :: OpenMP/target_teams_uses_allocators_codegen.cpp Clang :: OpenMP/target_uses_allocators_codegen.cpp Clang :: OpenMP/target_vla_messages.cpp Clang :: OpenMP/teams_codegen.cpp Clang :: OpenMP/teams_distribute_codegen.cpp Clang :: OpenMP/teams_distribute_collapse_codegen.cpp Clang :: OpenMP/teams_distribute_dist_schedule_codegen.cpp Clang :: OpenMP/teams_distribute_firstprivate_codegen.cpp Clang :: OpenMP/teams_distribute_lastprivate_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_collapse_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_copyin_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_dist_schedule_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_firstprivate_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_if_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_lastprivate_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_num_threads_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_private_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_proc_bind_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_reduction_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_schedule_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_collapse_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_dist_schedule_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_firstprivate_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_if_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_lastprivate_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_num_threads_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_private_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_proc_bind_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_reduction_codegen.cpp Clang :: OpenMP/teams_distribute_parallel_for_simd_schedule_codegen.cpp Clang :: OpenMP/teams_distribute_private_codegen.cpp Clang :: OpenMP/teams_distribute_reduction_codegen.cpp Clang :: OpenMP/teams_distribute_simd_codegen.cpp Clang :: OpenMP/teams_distribute_simd_collapse_codegen.cpp Clang :: OpenMP/teams_distribute_simd_dist_schedule_codegen.cpp Clang :: OpenMP/teams_distribute_simd_firstprivate_codegen.cpp Clang :: OpenMP/teams_distribute_simd_lastprivate_codegen.cpp Clang :: OpenMP/teams_distribute_simd_private_codegen.cpp Clang :: OpenMP/teams_distribute_simd_reduction_codegen.cpp Clang :: OpenMP/teams_firstprivate_codegen.cpp Clang :: OpenMP/teams_private_codegen.cpp Clang :: OpenMP/threadprivate_codegen.cpp LLVM :: Transforms/OpenMP/deduplication.ll libomptarget :: api/omp_get_num_devices.c libomptarget :: mapping/declare_mapper_api.cpp libomptarget :: mapping/delete_inf_refcount.c libomptarget :: mapping/pr38704.c libomptarget :: offloading/dynamic_module.c libomptarget :: offloading/dynamic_module_load.c libomptarget :: offloading/offloading_success.c libomptarget :: offloading/offloading_success.cpp libomptarget :: offloading/parallel_offloading_map.c libomptarget :: offloading/target_depend_nowait.cpp libomptarget :: unified_shared_memory/api.c libomptarget :: unified_shared_memory/close_enter_exit.c libomptarget :: unified_shared_memory/close_manual.c libomptarget :: unified_shared_memory/close_modifier.c libomptarget :: unified_shared_memory/shared_update.c
Isn't it initialized on line 1063 in CGOpenMPRuntime.cpp? There weren't any conflicts listed there when I merged your patch so it should be the same.
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. Sorry.
Reverting changed from D80735 and merging with origin/master. Adding an OpenMPIRBuilder object and removing the static methods caused a lot of the tests to fail. I think I'm going to try to get this version done and we can modify it later.
Nit: M is the commonly used name for a module ;)