[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-06 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 159335. gtbercea added a comment. Fix function call. Repository: rC Clang https://reviews.llvm.org/D47849 Files: include/clang/Driver/ToolChain.h lib/Driver/ToolChains/Clang.cpp lib/Driver/ToolChains/Cuda.cpp lib/Driver/ToolChains/Cuda.h lib

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-07 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D47849#1190903, @Hahnfeld wrote: > Do we still need this? I think what we really need to solve is the problem of > (host) inline assembly in the header files... Don't we want to use device specific math functions? It's not just about avoidi

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-08-07 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:664 + // Anything that's not a file name is potentially a static library + // so treat it as such. + if (C.canSkipOffloadBundler()) sfantao wrote: > So, what if it is not a

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-08-07 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 159536. gtbercea marked 3 inline comments as done. gtbercea added a comment. - Address comments. Repository: rC Clang https://reviews.llvm.org/D47394 Files: include/clang/Driver/Action.h include/clang/Driver/Compilation.h include/clang/Driver/Opti

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-07 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 159574. gtbercea added a comment. Prevent math builtins from being used for nvptx toolchain. Repository: rC Clang https://reviews.llvm.org/D47849 Files: include/clang/Driver/ToolChain.h lib/Driver/ToolChains/Clang.cpp lib/Driver/ToolChains/Cuda.cp

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. > Ok, so you are already talking about performance. I think we should fix > correctness first, in particular the compiler shouldn't complain whenever > `` is included. This patch is concerned with calling device functions when you're on the device. The correctness i

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D47849#1192245, @Hahnfeld wrote: > In https://reviews.llvm.org/D47849#1192134, @gtbercea wrote: > > > This patch is concerned with calling device functions when you're on the > > device. The correctness issues you mention are orthogonal to th

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. > IIRC you started to work on this to fix the problem with inline assembly (see > https://reviews.llvm.org/D47849#1125019). AFAICS this patch fixes > declarations of math functions but you still cannot include `math.h` which > most "correct" codes do. I'm not sure w

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D47849#1192368, @Hahnfeld wrote: > In https://reviews.llvm.org/D47849#1192321, @gtbercea wrote: > > > > IIRC you started to work on this to fix the problem with inline assembly > > > (see https://reviews.llvm.org/D47849#1125019). AFAICS this

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D47849#1192368, @Hahnfeld wrote: > In https://reviews.llvm.org/D47849#1192321, @gtbercea wrote: > > > > IIRC you started to work on this to fix the problem with inline assembly > > > (see https://reviews.llvm.org/D47849#1125019). AFAICS this

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D47849#1192383, @Hahnfeld wrote: > In https://reviews.llvm.org/D47849#1192375, @gtbercea wrote: > > > I do not get that error. > > > In the beginning you said that you were facing the same error. Did that go > away in the meantime? > Are you

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. @Hahnfeld do you get the same error if you compile with clang++ instead of clang? Repository: rC Clang https://reviews.llvm.org/D47849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-10 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. > The downside of this approach is that LLVM doesn't recognize these function > calls and doesn't perform optimizations to fold libcalls. For example `pow(a, > 2)` is transformed into a multiplication but `__nv_pow(a, 2)` is not. Doesn't CUDA have the same problem?

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-10 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. > I don't want to use a fast `pow(a, 2)`, I don't want to call a library > function for that at all. I do believe you won't end up calling a function. If you're compiling with optimizations on this will be inlined. Repository: rC Clang https://reviews.llvm.org

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. Thanks @Hahnfeld for your suggestions. Unfortunately doing the lowering in the backend one would need to replace the math function calls with calls to libdevice function calls. I have not been able to do that in an elegant way. Encoding the interface to libdevice is ju

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. Just to address any generality concerns: This patch fixes the problem of calling libdevice math functions for all platform combinations. It ensures that the OpenMP NVPTX target region will NOT call any host math functions (which ever host that may be) IF equivalent dev

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 160598. gtbercea added a comment. Herald added a subscriber: jholewinski. Add __NO_MATH_INLINES macro for the NVPTX toolchain to prevent any host assembly from seeping onto the device. Repository: rC Clang https://reviews.llvm.org/D47849 Files: inclu

[PATCH] D50845: [CUDA/OpenMP] Define only some host macros during device compilation

2018-08-16 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D50845#1202973, @ABataev wrote: > >> If I understand it correctly, the root cause of this exercise is that we > >> want to compile for GPU using plain C. CUDA avoids this issue by > >> separating device and host code via target attributes an

[PATCH] D50845: [CUDA/OpenMP] Define only some host macros during device compilation

2018-08-16 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D50845#1202991, @hfinkel wrote: > In https://reviews.llvm.org/D50845#1202965, @Hahnfeld wrote: > > > In https://reviews.llvm.org/D50845#1202963, @hfinkel wrote: > > > > > As a result, we should really have a separate header that has those > >

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-05-25 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. gtbercea added reviewers: Hahnfeld, hfinkel, caomhin, carlo.bertolli, tra. Herald added subscribers: cfe-commits, guansong. So far, the clang-offload-bundler has been the default tool for bundling together various files types produced by the different OpenMP offloa

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-05-25 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 148677. Repository: rC Clang https://reviews.llvm.org/D47394 Files: include/clang/Driver/Action.h include/clang/Driver/Compilation.h include/clang/Driver/Driver.h include/clang/Driver/ToolChain.h lib/Driver/Action.cpp lib/Driver/Compilation.cp

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-05-29 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: test/Driver/openmp-offload.c:497 // RUN: %clang -### -fopenmp=libomp -o %t.out -lsomelib -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %t.i -no-canonical-prefixes 2>&1 \ // RUN: | Fil

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-05-29 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: test/Driver/openmp-offload.c:497 // RUN: %clang -### -fopenmp=libomp -o %t.out -lsomelib -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %t.i -no-canonical-prefixes 2>&1 \ // RUN: | Fil

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-05-29 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:536 + } } sfantao wrote: > What prevents all this from being done in the bundler? If I understand it > correctly, if the bundler implements this wrapping all the checks for > librari

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-05-29 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D47394#1114848, @sfantao wrote: > Just to clarify one thing in my last comment: > > When I say that we didn't aim at having clang compatible with other > compilers, I mean the OpenMP offloading descriptors, where all the variables > and offl

[PATCH] D37913: [OpenMP] Enable the existing nocudalib flag for OpenMP offloading toolchain.

2017-09-25 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 116621. gtbercea added a comment. Split line. https://reviews.llvm.org/D37913 Files: lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c Index: test/Driver/openmp-offload-gpu.c =

[PATCH] D37914: [OpenMP] Don't throw cudalib not found error if only front-end is required.

2017-09-25 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea reopened this revision. gtbercea added a comment. This revision is now accepted and ready to land. Open. Repository: rL LLVM https://reviews.llvm.org/D37914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cg

[PATCH] D38040: [OpenMP] Add an additional test for D34888

2017-09-26 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 116664. gtbercea added a comment. Fix test. https://reviews.llvm.org/D38040 Files: test/OpenMP/target_map_codegen.cpp Index: test/OpenMP/target_map_codegen.cpp === --- test/OpenMP/target_m

[PATCH] D38040: [OpenMP] Add an additional test for D34888

2017-09-26 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 116671. gtbercea added a comment. Add nocudalib flag. https://reviews.llvm.org/D38040 Files: test/OpenMP/target_map_codegen.cpp Index: test/OpenMP/target_map_codegen.cpp === --- test/OpenM

[PATCH] D38040: [OpenMP] Add an additional test for D34888

2017-09-26 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea reopened this revision. gtbercea added a comment. This revision is now accepted and ready to land. Open https://reviews.llvm.org/D38040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D29660: [OpenMP] Add flag for overwriting default PTX version for OpenMP targets

2017-09-26 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea reopened this revision. gtbercea added a comment. This revision is now accepted and ready to land. Open Repository: rL LLVM https://reviews.llvm.org/D29660 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi

[PATCH] D38040: [OpenMP] Add an additional test for D34888

2017-09-26 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea reopened this revision. gtbercea added a comment. This revision is now accepted and ready to land. Open https://reviews.llvm.org/D38040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D38040: [OpenMP] Add an additional test for D34888

2017-09-26 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 116747. gtbercea added a comment. Fix test. https://reviews.llvm.org/D38040 Files: test/OpenMP/openmp_offload_codegen.cpp Index: test/OpenMP/openmp_offload_codegen.cpp === --- /dev/null ++

[PATCH] D38257: [OpenMP] Fix memory leak when translating arguments

2017-09-27 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea accepted this revision. gtbercea added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D38257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D38258: [OpenMP] Fix passing of -m arguments to device toolchain

2017-09-27 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: test/Driver/openmp-offload.c:89 +/// ### + /// Check the phases graph when using a single target, different from the host. Shouldn't these tests b

[PATCH] D38259: [OpenMP] Fix translation of target args

2017-09-27 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea accepted this revision. gtbercea added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D38259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D38258: [OpenMP] Fix passing of -m arguments to device toolchain

2017-09-27 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea accepted this revision. gtbercea added a comment. This revision is now accepted and ready to land. LGTM Comment at: test/Driver/openmp-offload.c:89 +/// ### + /// Check the phases graph when using

[PATCH] D38883: [CMake][OpenMP] Customize default offloading arch

2017-10-13 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:170-182 -// This code prevents IsValid from being set when -// no libdevice has been found. -bool allEmpty = true; -std::string LibDeviceFile; -for (auto key : LibDeviceMap.keys()) { -

[PATCH] D38883: [CMake][OpenMP] Customize default offloading arch

2017-10-13 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:170-182 -// This code prevents IsValid from being set when -// no libdevice has been found. -bool allEmpty = true; -std::string LibDeviceFile; -for (auto key : LibDeviceMap.keys()) { -

[PATCH] D38883: [CMake][OpenMP] Customize default offloading arch

2017-10-13 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.h:90 - } }; I would also like to keep the spirit of this code if not in this exact form at least something that performs the same functionality. https://reviews.llvm.org/D38883 _

[PATCH] D38883: [CMake][OpenMP] Customize default offloading arch

2017-10-13 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:170-182 -// This code prevents IsValid from being set when -// no libdevice has been found. -bool allEmpty = true; -std::string LibDeviceFile; -for (auto key : LibDeviceMap.keys()) { -

[PATCH] D38883: [CMake][OpenMP] Customize default offloading arch

2017-10-13 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:170-182 -// This code prevents IsValid from being set when -// no libdevice has been found. -bool allEmpty = true; -std::string LibDeviceFile; -for (auto key : LibDeviceMap.keys()) { -

[PATCH] D38883: [CMake][OpenMP] Customize default offloading arch

2017-10-13 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.h:90 - } }; gtbercea wrote: > I would also like to keep the spirit of this code if not in this exact form > at least something that performs the same functionality. @tra what's your opini

[PATCH] D38883: [CMake][OpenMP] Customize default offloading arch

2017-10-13 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.h:90 - } }; tra wrote: > gtbercea wrote: > > gtbercea wrote: > > > I would also like to keep the spirit of this code if not in this exact > > > form at least something that performs the s

[PATCH] D38883: [CMake][OpenMP] Customize default offloading arch

2017-10-13 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.h:90 - } }; gtbercea wrote: > tra wrote: > > gtbercea wrote: > > > gtbercea wrote: > > > > I would also like to keep the spirit of this code if not in this exact > > > > form at least som

[PATCH] D38883: [CMake][OpenMP] Customize default offloading arch

2017-10-16 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. LGTM https://reviews.llvm.org/D38883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D38976: [OpenMP] Add implicit data sharing support when offloading to NVIDIA GPUs using OpenMP device offloading

2017-10-16 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. Herald added a subscriber: jholewinski. This patch is part of the development effort to add support in the current OpenMP GPU offloading implementation for implicitly sharing variables between a target region executed by the team master thread and the worker threa

[PATCH] D38978: [OpenMP] Enable the lowering of implicitly shared variables in OpenMP GPU-offloaded target regions to the GPU shared memory

2017-10-16 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. Herald added subscribers: mgorny, jholewinski. This patch is part of the development effort to add support in the current OpenMP GPU offloading implementation for implicitly sharing variables between a target region executed by the team master thread and the worke

[PATCH] D39005: [OpenMP] Clean up variable and function names for NVPTX backend

2017-10-17 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. Herald added a subscriber: jholewinski. Clean-up variable and function names. Repository: rL LLVM https://reviews.llvm.org/D39005 Files: lib/Target/NVPTX/NVPTXAssignValidGlobalNames.cpp Index: lib/Target/NVPTX/NVPTXAssignValidGlobalNames.cpp ==

[PATCH] D38978: [OpenMP] Enable the lowering of implicitly shared variables in OpenMP GPU-offloaded target regions to the GPU shared memory

2017-10-17 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 119327. gtbercea added a comment. Eliminate variable and function name clean-up. That has been moved into a separate patch: https://reviews.llvm.org/D39005 Repository: rL LLVM https://reviews.llvm.org/D38978 Files: include/llvm/CodeGen/TargetPassConf

[PATCH] D39005: [OpenMP] Clean up variable and function names for NVPTX backend

2017-10-17 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. Hi Artem, Justin, I see that this patch is the same as the patch Arpith wanted to post a while back i.e. https://reviews.llvm.org/D17738. Was there a consensus regarding what the right thing to do is in this case? I'd be interested to get the ball rolling in regard to

[PATCH] D39005: [OpenMP] Clean up variable and function names for NVPTX backend

2017-10-18 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D39005#900226, @jlebar wrote: > > I'd be interested to get the ball rolling in regard to coming up with a fix > > for this. I see some suggestions in past patches. Some help/clarification > > would be much appreciated. > > Happy to help, but

[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

2018-08-23 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Basic/Targets/NVPTX.cpp:232 + // getting inlined on the device. + Builder.defineMacro("__NO_MATH_INLINES"); } tra wrote: > This relies on implementation detail of particular variant of the header file > you're a

[PATCH] D51312: [OpenMP][NVPTX] Use appropriate _CALL_ELF macro when offloading

2018-08-27 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. gtbercea added reviewers: Hahnfeld, ABataev, caomhin. Herald added subscribers: cfe-commits, guansong. When offloading to a device and using the powerpc64le version of the auxiliary triple, the _CALL_ELF macro is not set correctly to 2 resulting in the attempt to

[PATCH] D51312: [OpenMP][NVPTX] Use appropriate _CALL_ELF macro when offloading

2018-08-27 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 162708. gtbercea added a comment. Add test. Repository: rC Clang https://reviews.llvm.org/D51312 Files: lib/Frontend/InitPreprocessor.cpp test/Preprocessor/aux-triple.c Index: test/Preprocessor/aux-triple.c

[PATCH] D51446: [OpenMP][bugfix] Add missing macros for Power

2018-08-29 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. gtbercea added reviewers: ABataev, Hahnfeld, caomhin. Herald added subscribers: cfe-commits, guansong. Add missing macros when the auxiliary triple points to the PPC architecture. Repository: rC Clang https://reviews.llvm.org/D51446 Files: lib/Frontend/InitP

[PATCH] D51446: [OpenMP][bugfix] Add missing macros for Power

2018-08-30 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 163377. gtbercea added a comment. Add test. Repository: rC Clang https://reviews.llvm.org/D51446 Files: lib/Frontend/InitPreprocessor.cpp test/Preprocessor/aux-triple.c Index: test/Preprocessor/aux-triple.c ==

[PATCH] D50845: [CUDA/OpenMP] Define only some host macros during device compilation

2018-08-30 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D50845#1219709, @tra wrote: > FYI. This breaks our CUDA compilation. I haven't figured out what exactly is > wrong yet. I may need to unroll the patch if the fix is not obvious. Agreed. Patches https://reviews.llvm.org/D51446 and https://r

[PATCH] D50845: [CUDA/OpenMP] Define only some host macros during device compilation

2018-08-30 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D50845#1219746, @tra wrote: > Also, whatever macros we generate do not prevent headers from using x86 > inline assembly. I see quite a few inline asm code in preprocessed output. > The headers are from libc ~2.19. Did you try adding Bui

[PATCH] D50845: [CUDA/OpenMP] Define only some host macros during device compilation

2018-08-30 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D50845#1219859, @Hahnfeld wrote: > removing `InitializePredefinedAuxMacros` and the new test completely should > do. Yep they also contain https://reviews.llvm.org/D51312 in case you're rolling back individual commits. Repository: rL L

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-07-31 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea marked 3 inline comments as done. gtbercea added a comment. Answers to comments. Comment at: include/clang/Driver/Compilation.h:312 + /// \param skipBundler - bool value set once by the driver. + void setSkipOffloadBundler(bool skipBundler); + sfanta

[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-07-31 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: include/clang/Driver/Compilation.h:312 + /// \param skipBundler - bool value set once by the driver. + void setSkipOffloadBundler(bool skipBundler); + sfantao wrote: > gtbercea wrote: > > sfantao wrote: > > > gtbercea

[PATCH] D42841: [docs] Improve help for OpenMP options

2018-02-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea accepted this revision. gtbercea added a comment. LG https://reviews.llvm.org/D42841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-12 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. gtbercea added reviewers: Hahnfeld, ABataev, carlo.bertolli, caomhin, grokos. Herald added subscribers: cfe-commits, guansong. This patch adds an additional flag to the OpenMP device offloading toolchain to link in the runtime library bitcode. Repository: rC Cl

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-12 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 133882. gtbercea added a comment. Fix warning message. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp Index: lib/Driver/ToolChains/Cuda.cpp ==

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-12 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 133919. gtbercea added a comment. Add regression tests. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c Index: test/Driver/o

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 134235. gtbercea added a comment. Move unix specific test to new file. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c test/

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea marked an inline comment as done. gtbercea added inline comments. Comment at: test/Driver/openmp-offload-gpu.c:150 +/// bitcode library that will be found via the LIBRARY_PATH. +// RUN: touch /tmp/libomptarget-nvptx-sm_60.bc +// RUN: LIBRARY_PATH=/tmp %clang -### -fo

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 134238. gtbercea added a comment. Fix tmp folder name. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c test/Driver/unix-open

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: test/Driver/unix-openmp-offload-gpu.c:15 +/// bitcode library that will be found via the LIBRARY_PATH. +// RUN: touch /tmp/libomptarget-nvptx-sm_60.bc +// RUN: env LIBRARY_PATH=/tmp Hahnfeld wrote: > Hahnfeld wrote:

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 134278. gtbercea added a comment. Use %T. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c test/Driver/unix-openmp-offload-gp

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D43197#1007918, @Hahnfeld wrote: > I'm still not sure we can't run this test on Windows. I think lots of other > tests use `touch`, even some specific to Windows... Let me know what you'd like me to do. I can add the test back. I do see oth

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 134292. gtbercea added a comment. Revert. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c Index: test/Driver/openmp-offload-

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-02-14 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 134295. gtbercea added a comment. Fix test. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c Index: test/Driver/openmp-offloa

[PATCH] D43625: [OpenMP] Remove implicit data sharing code gen that aims to use device shared memory

2018-02-22 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. gtbercea added reviewers: ABataev, carlo.bertolli, caomhin. Herald added subscribers: cfe-commits, guansong, jholewinski. Remove this scheme for now since it will be covered by another more generic scheme using global memory. This code will be worked into an optimi

[PATCH] D43660: [OpenMP] Add OpenMP data sharing infrastructure using global memory

2018-02-22 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. gtbercea added reviewers: ABataev, carlo.bertolli, caomhin, hfinkel, Hahnfeld. Herald added subscribers: cfe-commits, guansong, jholewinski. This patch handles the Clang code generation phase for the OpenMP data sharing infrastructure. TODO: add a more detailed de

[PATCH] D41485: [OpenMP][libomptarget] Add data sharing support in libomptarget

2017-12-21 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. gtbercea added reviewers: carlo.bertolli, ABataev, Hahnfeld, grokos, caomhin, hfinkel. This patch extends the libomptarget functionality in patch https://reviews.llvm.org/D14254 with support for the data sharing scheme for supporting implicitly shared variables.

[PATCH] D41486: [OpenMP][Clang] Add missing argument to runtime functions.

2017-12-21 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea created this revision. gtbercea added reviewers: ABataev, carlo.bertolli, hfinkel, Hahnfeld, caomhin. Herald added a subscriber: jholewinski. This patch adds a missing argument to the runtime interface. Tests are adjusted accordingly. Repository: rL LLVM https://reviews.llvm.org/D41

[PATCH] D41486: [OpenMP][Clang] Add missing argument to runtime functions.

2017-12-21 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D41486#961981, @Hahnfeld wrote: > https://reviews.llvm.org/D41012? This patch doesn't update the documentation > with function signatures. Ok so I see that your patch uses a different order of the arguments. I've just added the data sharin

[PATCH] D41486: [OpenMP][Clang] Add missing argument to runtime functions.

2017-12-21 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 127865. gtbercea added a comment. Address comments. Repository: rL LLVM https://reviews.llvm.org/D41486 Files: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp test/OpenMP/nvptx_data_sharing.cpp test/OpenMP/nvptx_target_teams_codegen.cpp Index: test/OpenMP/n

[PATCH] D40451: [OpenMP] Add function attribute for triggering shared memory lowering in the LLVM backend

2017-12-21 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea closed this revision. gtbercea added a comment. Committed here https://reviews.llvm.org/D41123 Repository: rL LLVM https://reviews.llvm.org/D40451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mail

[PATCH] D41486: [OpenMP][Clang] Add missing argument to runtime functions.

2018-01-03 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea abandoned this revision. gtbercea added a comment. Functionality already landed. See previous comment. Repository: rL LLVM https://reviews.llvm.org/D41486 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-

[PATCH] D43660: [OpenMP] Add OpenMP data sharing infrastructure using global memory

2018-03-01 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 136528. Repository: rC Clang https://reviews.llvm.org/D43660 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CGOpenMPRuntime.h lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp lib/CodeGen/CGOpenMPRuntimeNVPTX.h lib/CodeGen/CGStmt

[PATCH] D43625: [OpenMP] Remove implicit data sharing code gen that aims to use device shared memory

2018-03-01 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 136570. gtbercea added a comment. Add Source location. Repository: rC Clang https://reviews.llvm.org/D43625 Files: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp lib/CodeGen/CGOpenMPRuntimeNVPTX.h test/OpenMP/nvptx_data_sharing.cpp test/OpenMP/nvptx_paral

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-05 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added a comment. In https://reviews.llvm.org/D43197#1011256, @Hahnfeld wrote: > Looking more closely at the patch, this doesn't seem to look into the `lib` / > `lib64` next to the compiler. I'm not sure if `LIBRARY_PATH` is set for every > installation, so I think we should add this on

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-05 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:536-542 + StringRef CompilerPath = env; + while (!CompilerPath.empty()) { +std::pair Split = +CompilerPath.split(llvm::sys::EnvPathSeparator); +LibraryPaths.push_back(

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-06 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137203. gtbercea added a comment. Address comments. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c Index: test/Driver/openm

[PATCH] D43660: [OpenMP] Add OpenMP data sharing infrastructure using global memory

2018-03-06 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137210. gtbercea added a comment. Add init stack function. Repository: rC Clang https://reviews.llvm.org/D43660 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CGOpenMPRuntime.h lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp li

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-06 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137219. gtbercea added a comment. Address comments. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c Index: test/Driver/openm

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-06 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137226. gtbercea added a comment. Address comments. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c Index: test/Driver/openm

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-06 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137230. gtbercea added a comment. Fix test. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c Index: test/Driver/openmp-offloa

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-06 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137233. gtbercea added a comment. - Fix message and test. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/openmp-offload-gpu.c Index: test/Driver

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:536-542 + StringRef CompilerPath = env; + while (!CompilerPath.empty()) { +std::pair Split = +CompilerPath.split(llvm::sys::EnvPathSeparator); +LibraryPaths.push_back(

[PATCH] D43660: [OpenMP] Add OpenMP data sharing infrastructure using global memory

2018-03-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137600. gtbercea added a comment. Patch splitting: limit support in this patch to standalone target regions only. Support for combined directives will be fully covered in a subsequent patch. Repository: rC Clang https://reviews.llvm.org/D43660 Files:

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-09 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea marked an inline comment as done. gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:536-542 + StringRef CompilerPath = env; + while (!CompilerPath.empty()) { +std::pair Split = +CompilerPath.split(llvm::sys::EnvPathS

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-09 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137754. gtbercea added a comment. Change test. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/Inputs/lib/libomptarget-nvptx-sm_60.bc test/Driver

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-09 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:592 +Twine("lib") + CLANG_LIBDIR_SUFFIX); +LibraryPaths.emplace_back(DefaultLibPath.c_str()); + ABataev wrote: > Do you still need `.c_str()` here? Doesn't compile without it b

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-09 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137755. gtbercea added a comment. Revert to c_str(). Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/Inputs/lib/libomptarget-nvptx-sm_60.bc test/

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-09 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea added inline comments. Comment at: test/Driver/openmp-offload-gpu.c:150 +/// bitcode library and add it to the LIBRARY_PATH. +// RUN: touch %T/libomptarget-nvptx-sm_60.bc +// RUN: env LIBRARY_PATH=%T %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \

[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

2018-03-09 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 137769. gtbercea added a comment. Fix test. Repository: rC Clang https://reviews.llvm.org/D43197 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains/Cuda.cpp test/Driver/Inputs/lib/libomptarget-nvptx-sm_20.bc test/Driver/op

  1   2   3   4   5   6   7   >