r262516 - Fixed test failure platforms with name mangling different from Linux.

2016-03-02 Thread Artem Belevich via cfe-commits
Author: tra Date: Wed Mar 2 15:03:20 2016 New Revision: 262516 URL: http://llvm.org/viewvc/llvm-project?rev=262516&view=rev Log: Fixed test failure platforms with name mangling different from Linux. * Run cc with -triple x86_64-linux-gnu to make symbol mangling predictable. * Use temporary file a

[PATCH] D18051: [CUDA] Provide CUDA's vector types implemented using clang's vector extension.

2016-03-10 Thread Artem Belevich via cfe-commits
tra created this revision. tra added reviewers: jlebar, jingyue. tra added a subscriber: cfe-commits. This provides substantial performance boost on some benchmarks (~25% on SHOC's FFT) due to vectorized loads/stores. Unfortunately existing CUDA headers and user code occasionally take pointer to

Re: [PATCH] D18051: [CUDA] Provide CUDA's vector types implemented using clang's vector extension.

2016-03-10 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 50341. tra marked an inline comment as done. tra added a comment. Removed unneeded struct attributes. http://reviews.llvm.org/D18051 Files: lib/Headers/CMakeLists.txt lib/Headers/__clang_cuda_runtime_wrapper.h lib/Headers/__clang_cuda_vector_types.h lib

Re: [PATCH] D18051: [CUDA] Provide CUDA's vector types implemented using clang's vector extension.

2016-03-10 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Headers/__clang_cuda_runtime_wrapper.h:72 @@ -71,1 +71,3 @@ +#if defined(CUDA_VECTOR_TYPES) +// Prevent inclusion of CUDA's vector_types.h jlebar wrote: > Hm, this is a surprising (to me) way of controlling this feature

Re: [PATCH] D18051: [CUDA] Provide CUDA's vector types implemented using clang's vector extension.

2016-03-10 Thread Artem Belevich via cfe-commits
tra abandoned this revision. tra added a comment. Ugh. Found more problems with using vector types in C++. Abandoning the idea. http://reviews.llvm.org/D18051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mail

Re: [PATCH] D18051: [CUDA] Provide CUDA's vector types implemented using clang's vector extension.

2016-03-10 Thread Artem Belevich via cfe-commits
There were ambiguities in overload resolution between vector types and their base types. I.e. if I had void foo(int); void foo(int3); then call foo(3) was ambiguous. It wasn't clear whether this extension is supposed to work in C++ at all. On Thu, Mar 10, 2016 at 4:05 PM, Hal Finkel wrote:

Re: [PATCH] D18328: [CUDA] Add option to mark most functions inside as host+device.

2016-03-21 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. One minor question, LGTM otherwise. Comment at: lib/Sema/SemaCUDA.cpp:474 @@ +473,3 @@ + SourceLocation Loc = FD.getLocation(); + if (!SM.isInSystemHeader(Loc)) +return false;

Re: [PATCH] D18328: [CUDA] Add option to mark most functions inside as host+device.

2016-03-21 Thread Artem Belevich via cfe-commits
tra added a comment. In http://reviews.llvm.org/D18328#379824, @rsmith wrote: > I would much prefer for us to, say, provide a header that wraps the > system one and does something like > > // > #pragma clang cuda_implicit_host_device { > #include_next > #pragma clang cuda_implicit_hos

Re: [PATCH] D18170: [CUDA][OpenMP] Create generic offload toolchains

2016-03-22 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: include/clang/Driver/Action.h:79 @@ +78,3 @@ +OFFLOAD_None = 0x00, +OFFLOAD_CUDA = 0x01, + }; Nit: All-caps CUDA looks weird here. _Cuda may be better choice. If you can shorten the prefix that would be nice, too. OK

Re: [PATCH] D18380: [CUDA] Implement -fcuda-relaxed-constexpr, and enable it by default.

2016-03-22 Thread Artem Belevich via cfe-commits
tra added a comment. Now that H/D and HD cal all be in the same overload set, we'll also need additional tests in CodeGenCUDA/function-overload.cu for cases that now became legal. http://reviews.llvm.org/D18380 ___ cfe-commits mailing list cfe-com

Re: [PATCH] D18380: [CUDA] Implement -fcuda-relaxed-constexpr, and enable it by default.

2016-03-22 Thread Artem Belevich via cfe-commits
We need tests to demonstrate that we pick correct function when we have mix of HD+H/D in the overload set. Existing tests only cover resolution of {HD,HD}, {H,H} {D,D} {H,D} sets On Tue, Mar 22, 2016 at 4:59 PM, Justin Lebar wrote: > jlebar added a comment. > > In http://reviews.llvm.org/D18380#

Re: [PATCH] D18385: [CUDA] Simplify SemaCUDA/function-overload.cu test.

2016-03-23 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. Small nit, LGTM otherwise. Comment at: test/SemaCUDA/function-overload.cu:66 @@ +65,3 @@ +__device__ int d() { return 8; } +// expected-note@-1 0+ {{'d' declared here}} +// expected

Re: [PATCH] D18171: [CUDA][OpenMP] Create generic offload action

2016-03-23 Thread Artem Belevich via cfe-commits
tra added a comment. Thank you for making these changes. They don't solve all the shortcomings, but they improve things quite a bit, IMO. Overall I'm happy with the changes, though use of mutable and changing action state from const functions may need a look from someone with better C++-fu ski

Re: [PATCH] D18380: [CUDA] Implement -fcuda-relaxed-constexpr, and enable it by default.

2016-03-23 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Sema/SemaDecl.cpp:8011-8013 @@ +8010,5 @@ + // allowed, so we just treat those as host-only. + if (getLangOpts().CUDA && getLangOpts().CUDAHostDeviceConstexpr && + NewFD->isConstexpr() && !NewFD->isVariadic() && + !NewFD->hasA

Re: [PATCH] D18380: [CUDA] Make unattributed constexpr functions (usually) implicitly host+device.

2016-03-28 Thread Artem Belevich via cfe-commits
tra added a comment. I wonder if we can find a way to decide whether particular constexpr function should be treated as HD or not without relying on particular order the functions are seen by compiler (or whether they come from system headers). Right now we're relying on checking overloads of c

Re: [PATCH] D15686: PR25910: clang allows two var definitions with the same mangled name

2016-01-04 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:1235-1236 @@ -1235,8 +1234,4 @@ // different type. -// FIXME: Support for variables is not implemented yet. -if (isa(D.getDecl())) - GV = cast(GetAddrOfGlobal(D, /*IsForDefinition=*/true)); -

Re: [PATCH] D15686: PR25910: clang allows two var definitions with the same mangled name

2016-01-05 Thread Artem Belevich via cfe-commits
tra added a comment. A better description of the problem would help. PR itself is somewhat short on details. If I understand it correctly, the problem is that if we create multiple definitions with the same mangled name, clang does not always report it as an error and only emits one of those in

Re: r256854 - [OpenMP] Allow file ID to be signed in the offloading metadata.

2016-01-05 Thread Artem Belevich via cfe-commits
Samuel, The tests are still failing: http://lab.llvm.org:8011/builders/clang-bpf-build/builds/5759 On Tue, Jan 5, 2016 at 10:02 AM, Samuel Antao via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: sfantao > Date: Tue Jan 5 12:02:24 2016 > New Revision: 256854 > > URL: http://llvm.o

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2016-01-05 Thread Artem Belevich via cfe-commits
tra added a comment. ping. http://reviews.llvm.org/D15305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15596: Add -L/path/to/cuda/lib if any of our inputs are CUDA files.

2016-01-05 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Driver/ToolChains.cpp:4125 @@ +4124,3 @@ + ArgStringList &LDArgs) const { + if (DriverArgs.hasArg(options::OPT_nocudalib) || !CudaInstallation.isValid()) +return; I'd rename -nocudalib to

Re: [PATCH] D15933: Rename -nocudalib to -nocudalibdevice.

2016-01-06 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM http://reviews.llvm.org/D15933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15596: Add -L/path/to/cuda/lib if any of our inputs are CUDA files.

2016-01-06 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: include/clang/Driver/Options.td:1636 @@ -1635,1 +1635,3 @@ +def nocudalib : Flag<["-"], "nocudalib">, + HelpText<"Don't include libraries necessary for running CUDA (-L/path/to/cuda/lib{,64} -lcudart_static -lrt -lpthread -ldl)">; def nocu

Re: [PATCH] D15936: Update code in buildCudaActions and BuildActions to latest idiom.

2016-01-06 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM Comment at: lib/Driver/Driver.cpp:1300 @@ -1299,5 +1299,3 @@ for (Arg *A : Args) { -if (A->getOption().matches(options::OPT_cuda_gpu_arch_EQ)) { - A->claim(); -

Re: [PATCH] D15596: Add -L/path/to/cuda/lib if any of our inputs are CUDA files.

2016-01-06 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. Minor nit, but looks good otherwise. Comment at: include/clang/Driver/Options.td:1636 @@ -1635,1 +1635,3 @@ +def nocudalib : Flag<["-"], "nocudalib">, + HelpText<"Don't link with l

Re: [PATCH] D15939: Pass the Compilation as an arg to AddLinkerInputs.

2016-01-06 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM. http://reviews.llvm.org/D15939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15596: Add -L/path/to/cuda/lib if any of our inputs are CUDA files.

2016-01-06 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Driver/Tools.cpp:276 @@ +275,3 @@ + + // Add -L/path/to/cuda/lib if any of our inputs are .cu files. + if (std::any_of(C.getActions().begin(), C.getActions().end(), isCudaAction)) It just struck me that this patch may n

Re: [PATCH] D15974: [CUDA] Split out tests for unused-arg warnings from cuda-options.cu.

2016-01-07 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM. http://reviews.llvm.org/D15974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15911: Move ownership of Action objects into Compilation.

2016-01-08 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: include/clang/Driver/Action.h:36 @@ -35,1 +35,3 @@ +/// +/// Actions are usually owned by a Compilation. class Action { There's no API to pass ownership to Compilation explicitly, so the only way for an Action to be owned b

Re: [PATCH] D16082: [CUDA] Invoke ptxas and fatbinary during compilation.

2016-01-11 Thread Artem Belevich via cfe-commits
tra added a comment. Make sure it works with -save-temps and -fintegrated-as/-fno-integrated-as. They tend to throw wrenches into pipeline construction. Comment at: lib/Driver/Driver.cpp:1380 @@ +1379,3 @@ + C.MakeAction(DeviceActions, types::TY_CUDA_FATBIN), + /* Gpu

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2016-01-12 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 44687. tra added a comment. Check all variable initializers and only allow 'empty constructors' as Richard has suggested. Changed test structure so that we test for allowed/disallowed constructors separately from testing how we handle initialization of base clas

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2016-01-12 Thread Artem Belevich via cfe-commits
tra added a comment. Richard, I've updated the patch as you've suggested -- it indeed simplifies things quite a bit and handles the corner cases you've mentioned. Comment at: lib/CodeGen/CGDeclCXX.cpp:323-324 @@ +322,4 @@ + + // The constructor function has no parameters, + i

Re: [PATCH] D16082: [CUDA] Invoke ptxas and fatbinary during compilation.

2016-01-12 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM. http://reviews.llvm.org/D16082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D16080: [CUDA] Add tests for compiling CUDA files with -E.

2016-01-13 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: test/Driver/cuda-preprocess.cu:13-16 @@ +12,6 @@ + +// RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 %s 2>&1 \ +// RUN: | FileCheck -check-prefix NOARCH %s +// RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 -

Re: [PATCH] D16081: [CUDA] Add test for compiling CUDA code with -S.

2016-01-13 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM. http://reviews.llvm.org/D16081 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2016-01-15 Thread Artem Belevich via cfe-commits
tra added a reviewer: jlebar. tra updated this revision to Diff 45044. tra added a comment. Moved initializer checks from CodeGen to Sema. Added test cases for initializers of non-class variables. http://reviews.llvm.org/D15305 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2016-01-15 Thread Artem Belevich via cfe-commits
tra marked an inline comment as done. tra added a comment. In http://reviews.llvm.org/D15305#327226, @rsmith wrote: > I think you missed this from my previous review: > > > This should be checked and diagnosed in Sema, not in CodeGen. > Done. http://reviews.llvm.org/D15305

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2016-01-15 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:2334 @@ -2339,1 +2333,3 @@ + D->hasAttr()) Init = llvm::UndefValue::get(getTypes().ConvertType(ASTTy)); + else if (!InitExpr) { rsmith wrote: > As this is a global variable, it should

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2016-01-15 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 45051. tra marked an inline comment as done. tra added a comment. Typo fix. http://reviews.llvm.org/D15305 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/CodeGen/CGDeclCXX.cpp lib/CodeGen/CodeGenModule.cpp lib/Sema/Sem

Re: [PATCH] D16250: Respect bound archs, even when they don't alter the toolchain.

2016-01-15 Thread Artem Belevich via cfe-commits
tra added a comment. Looks OK to me. Perhaps BoundArch w/o toolchain is sufficient for the key as toolchain would be derived from it. http://reviews.llvm.org/D16250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-

Re: [PATCH] D16307: [CUDA] Handle -O options (more) correctly.

2016-01-19 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM. http://reviews.llvm.org/D16307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D16261: [CUDA] Only allow __global__ on free functions and static member functions.

2016-01-19 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6418 @@ +6417,3 @@ +def warn_nvcc_compat_kern_is_method : Warning< + "kernel function %0 is a member function; this may not be accepted by nvcc">, + InGroup; There's an Extension<>

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2016-01-19 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 45312. tra marked 2 inline comments as done. tra added a comment. Addressed Justin's comments. http://reviews.llvm.org/D15305 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/CodeGen/CGDeclCXX.cpp lib/CodeGen/CodeGenModule

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2016-01-19 Thread Artem Belevich via cfe-commits
tra marked 3 inline comments as done. Comment at: lib/Sema/SemaCUDA.cpp:436 @@ +435,3 @@ + if (CD->isTrivial()) +return true; + jlebar wrote: > The test passes if I comment out this if statement. I'm not sure if that's > expected; this may or may not be ent

Re: [PATCH] D16261: [CUDA] Only allow __global__ on free functions and static member functions.

2016-01-19 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. Small diags not. LGTM otherwise. Comment at: lib/Sema/SemaDeclAttr.cpp:3620-3629 @@ -3619,2 +3619,12 @@ } + if (const auto *Method = dyn_cast(FD)) { +if (Method->isInstance(

Re: [PATCH] D16331: [CUDA] Bail, rather than crash, on va_arg in device code.

2016-01-19 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. Small nit. LGTM otherwise. Comment at: lib/Sema/SemaExpr.cpp:11732 @@ +11731,3 @@ + // CUDA device code does not support varargs. + if (getLangOpts().CUDAIsDevice) { +if (cons

Re: [PATCH] D16261: [CUDA] Only allow __global__ on free functions and static member functions.

2016-01-19 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:3620-3629 @@ -3619,2 +3619,12 @@ } + if (const auto *Method = dyn_cast(FD)) { +if (Method->isInstance()) { + S.Diag(Method->getLocStart(), diag::err_kern_is_nonstatic_method) + << Method; +

Re: [PATCH] D16372: [CUDA] Make printf work.

2016-01-20 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/CodeGen/CGCUDACall.cpp:1 @@ +1,2 @@ +//===- CGCUDACall.cpp - Codegen for special CUDA calls ===// +// We'll need to handle other builtins soon. Perhaps we can keep them in this file and rename it CGC

Re: [PATCH] D16484: [CUDA] Disallow variadic functions other than printf in device code.

2016-01-22 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. Small nit. LGTM otherwise. Comment at: lib/Sema/SemaDecl.cpp:8291-8293 @@ +8290,5 @@ +// in device-side CUDA code. +if (NewFD->isVariadic() && (NewFD->hasAttr() || +

Re: [PATCH] D16499: [CUDA] Disable ctor/dtor aliases in device code.

2016-01-25 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM. http://reviews.llvm.org/D16499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D16501: [CUDA] Don't generate aliases for static extern "C" functions.

2016-01-25 Thread Artem Belevich via cfe-commits
tra added a comment. Failing silently is not a good idea. At the very least there should produce an error. The right thing to do here, IMO, would be to generate a stub with alias name that just jumps to or calls aliasee. http://reviews.llvm.org/D16501 ___

Re: [PATCH] D16501: [CUDA] Don't generate aliases for static extern "C" functions.

2016-01-25 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. OK. If someone attempts to rely on this feature in CUDA it will be obviously broken due to the missing C-style mangled name. We can deal with it then. http://reviews.llvm.org/D16501

Re: [PATCH] D16559: [CUDA] Add -fcuda-allow-variadic-functions.

2016-01-26 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. LGTM. http://reviews.llvm.org/D16559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D16559: [CUDA] Add -fcuda-allow-variadic-functions.

2016-01-26 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: cfe/trunk/include/clang/Driver/CC1Options.td:681 @@ -680,1 +680,3 @@ HelpText<"Enable function overloads based on CUDA target attributes.">; +def fcuda_allow_variadic_functions : Flag<["-"], "fcuda-allow-variadic-functions">, + HelpText<

[PATCH] D16593: [CUDA] Implemented device-side support for functions in .

2016-01-26 Thread Artem Belevich via cfe-commits
tra created this revision. tra added a reviewer: jlebar. tra added a subscriber: cfe-commits. CUDA expects math functions in std:: namespace to work on device side. In order to make it work with clang without allowing device-side code generation for functions w/o appropriate target attributes, thi

Re: [PATCH] D16593: [CUDA] Implemented device-side support for functions in .

2016-01-26 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 46041. tra marked 3 inline comments as done. tra added a comment. Added missing :: http://reviews.llvm.org/D16593 Files: lib/Headers/CMakeLists.txt lib/Headers/__clang_cuda_cmath.h lib/Headers/__clang_cuda_runtime_wrapper.h Index: lib/Headers/__clang_cud

Re: [PATCH] D16593: [CUDA] Implemented device-side support for functions in .

2016-01-26 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 46055. tra marked 6 inline comments as done. tra added a comment. Fixed few issues revealed by -Wdouble-promotion http://reviews.llvm.org/D16593 Files: lib/Headers/CMakeLists.txt lib/Headers/__clang_cuda_cmath.h lib/Headers/__clang_cuda_runtime_wrapper.h

Re: [PATCH] D16593: [CUDA] Implemented device-side support for functions in .

2016-01-26 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Headers/__clang_cuda_cmath.h:33 @@ +32,3 @@ +// builtins if CUDA does not provide a suitable function. +// We also provide device-side std::abs() for integer types. + jlebar wrote: > Why is std::abs a special case that ne

r258880 - [CUDA] Implemented device-side support functions in .

2016-01-26 Thread Artem Belevich via cfe-commits
Author: tra Date: Tue Jan 26 17:37:29 2016 New Revision: 258880 URL: http://llvm.org/viewvc/llvm-project?rev=258880&view=rev Log: [CUDA] Implemented device-side support functions in . CUDA expects math functions in std:: namespace to work on device side. In order to make it work with clang withou

Re: [PATCH] D16593: [CUDA] Implemented device-side support for functions in .

2016-01-26 Thread Artem Belevich via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL258880: [CUDA] Implemented device-side support functions in . (authored by tra). Changed prior to commit: http://reviews.llvm.org/D16593?vs=46055&id=46066#toc Repository: rL LLVM http://reviews.llvm

[PATCH] D16638: [CUDA] Added device-side std::{malloc/free}

2016-01-27 Thread Artem Belevich via cfe-commits
tra created this revision. tra added a reviewer: jlebar. tra added a subscriber: cfe-commits. In addition to math functions, we also need to support std::malloc and std::free to match NVCC behavior. http://reviews.llvm.org/D16638 Files: lib/Headers/__clang_cuda_cmath.h lib/Headers/__clang_c

Re: [PATCH] D16514: Add -stop-on-failure driver option, and enable it by default for CUDA compiles.

2016-01-28 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: include/clang/Driver/Options.td:1807 @@ +1806,3 @@ +"CUDA compilation without --save-temps.">; +def nostop_on_failure : Flag<["-"], "nostop-on-failure">, Flags<[DriverOption]>; + I'd use 'no-' prefix. C

Re: [PATCH] D16514: Add -stop-on-failure driver option, and enable it by default for CUDA compiles.

2016-01-28 Thread Artem Belevich via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM. Comment at: lib/Driver/Driver.cpp:652 @@ -640,3 +651,3 @@ SmallVector, 4> FailingCommands; - C.ExecuteJobs(C.getJobs(), FailingCommands); + C.ExecuteJobs(C.getJobs(), /*

Re: [PATCH] D16514: Add -stop-on-failure driver option, and enable it by default for CUDA compiles.

2016-01-28 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Driver/Driver.cpp:652 @@ -640,3 +651,3 @@ SmallVector, 4> FailingCommands; - C.ExecuteJobs(C.getJobs(), FailingCommands); + C.ExecuteJobs(C.getJobs(), /* StopOnFailure = */ false, FailingCommands); jlebar wrote: >

Re: [PATCH] D13144: [CUDA] propagate to CUDA sub-compilations target triple of opposite side.

2015-11-13 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 40163. tra added a comment. Added a FIXME note regarding figuring out which compilation pass we're constructing. Undone the change to make getToolchain public as it's no longer accessed from outside of Driver. Converted the if(AuxToolchain) into assert. http:/

r253386 - [CUDA] added include paths for both sides of CUDA compilation.

2015-11-17 Thread Artem Belevich via cfe-commits
Author: tra Date: Tue Nov 17 16:28:46 2015 New Revision: 253386 URL: http://llvm.org/viewvc/llvm-project?rev=253386&view=rev Log: [CUDA] added include paths for both sides of CUDA compilation. In order to compile a CUDA file clang must be able to find include files for both both host and device.

r253387 - [CUDA] Detect and link with CUDA's libdevice bitcode library.

2015-11-17 Thread Artem Belevich via cfe-commits
Author: tra Date: Tue Nov 17 16:28:50 2015 New Revision: 253387 URL: http://llvm.org/viewvc/llvm-project?rev=253387&view=rev Log: [CUDA] Detect and link with CUDA's libdevice bitcode library. - added detection of libdevice bitcode file and API to find one appropriate for the GPU we're compiling

r253385 - [CUDA] use -aux-triple to pass target triple of opposite side of compilation

2015-11-17 Thread Artem Belevich via cfe-commits
Author: tra Date: Tue Nov 17 16:28:40 2015 New Revision: 253385 URL: http://llvm.org/viewvc/llvm-project?rev=253385&view=rev Log: [CUDA] use -aux-triple to pass target triple of opposite side of compilation Clang needs to know target triple for both sides of compilation so that preprocessor macro

Re: [PATCH] D13144: [CUDA] propagate to CUDA sub-compilations target triple of opposite side.

2015-11-17 Thread Artem Belevich via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL253385: [CUDA] use -aux-triple to pass target triple of opposite side of compilation (authored by tra). Changed prior to commit: http://reviews.llvm.org/D13144?vs=40163&id=40432#toc Repository: rL LL

Re: [PATCH] D13170: [CUDA] Driver changes to pass flags needed to use detected CUDA installation.

2015-11-17 Thread Artem Belevich via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL253386: [CUDA] added include paths for both sides of CUDA compilation. (authored by tra). Changed prior to commit: http://reviews.llvm.org/D13170?vs=39860&id=40433#toc Repository: rL LLVM http://rev

r253388 - [CUDA] Added a wrapper header for inclusion of stock CUDA headers.

2015-11-17 Thread Artem Belevich via cfe-commits
Author: tra Date: Tue Nov 17 16:28:52 2015 New Revision: 253388 URL: http://llvm.org/viewvc/llvm-project?rev=253388&view=rev Log: [CUDA] Added a wrapper header for inclusion of stock CUDA headers. Header files that come with CUDA are assuming split host/device compilation and are not usable by cl

Re: [PATCH] D14556: [CUDA] Detect and link with CUDA's libdevice bitcode library.

2015-11-17 Thread Artem Belevich via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL253387: [CUDA] Detect and link with CUDA's libdevice bitcode library. (authored by tra). Changed prior to commit: http://reviews.llvm.org/D14556?vs=39863&id=40434#toc Repository: rL LLVM http://revi

r253389 - [CUDA] Make CUDA compilation usable by default.

2015-11-17 Thread Artem Belevich via cfe-commits
Author: tra Date: Tue Nov 17 16:28:55 2015 New Revision: 253389 URL: http://llvm.org/viewvc/llvm-project?rev=253389&view=rev Log: [CUDA] Make CUDA compilation usable by default. Currently clang requires several additional command line options in order to enable new features needed during CUDA com

Re: [PATCH] D13171: [CUDA] Added a wrapper header for inclusion of stock CUDA headers.

2015-11-17 Thread Artem Belevich via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL253388: [CUDA] Added a wrapper header for inclusion of stock CUDA headers. (authored by tra). Changed prior to commit: http://reviews.llvm.org/D13171?vs=38574&id=40435#toc Repository: rL LLVM http:/

r253410 - Fix for use-after-free which caused test failure in cuda-detect.cu.

2015-11-17 Thread Artem Belevich via cfe-commits
Author: tra Date: Tue Nov 17 18:37:41 2015 New Revision: 253410 URL: http://llvm.org/viewvc/llvm-project?rev=253410&view=rev Log: Fix for use-after-free which caused test failure in cuda-detect.cu. Return std::string itself instead StringRef to a temporary std::string. Modified: cfe/trunk/li

Re: r253410 - Fix for use-after-free which caused test failure in cuda-detect.cu.

2015-11-17 Thread Artem Belevich via cfe-commits
n Tue, Nov 17, 2015 at 4:37 PM, Artem Belevich via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: tra >> Date: Tue Nov 17 18:37:41 2015 >> New Revision: 253410 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=253410&view=rev >> Log

r253947 - Do not attempt to include CUDA headers during the test.

2015-11-23 Thread Artem Belevich via cfe-commits
Author: tra Date: Mon Nov 23 20:45:55 2015 New Revision: 253947 URL: http://llvm.org/viewvc/llvm-project?rev=253947&view=rev Log: Do not attempt to include CUDA headers during the test. Modified: cfe/trunk/test/Driver/cuda-simple.cu Modified: cfe/trunk/test/Driver/cuda-simple.cu URL: http:/

[PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2015-12-07 Thread Artem Belevich via cfe-commits
tra created this revision. tra added reviewers: rsmith, jingyue, jpienaar. tra added a subscriber: cfe-commits. In general CUDA does not allow dynamic initialization of global device-side variables except for records with empty constructors as described in section [[ http://docs.nvidia.com/cuda/

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2015-12-07 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/CodeGen/CGDeclCXX.cpp:329 @@ +328,3 @@ + for (const CXXCtorInitializer *CI: CD->inits()) +if (CI->isAnyMemberInitializer() && CI->isWritten()) + return false; @rsmith: is this a good way to find member initializ

[PATCH] D15309: [CUDA] emit vtables only for classes with methods usable on this side of compilation.

2015-12-07 Thread Artem Belevich via cfe-commits
tra created this revision. tra added reviewers: rsmith, jingyue, jpienaar. tra added a subscriber: cfe-commits. C++ emits vtables for classes that have key function present in the current TU. While we compile CUDA the fact that key function was found in this TU does not mean that we are going to g

Re: [PATCH] D15309: [CUDA] emit vtables only for classes with methods usable on this side of compilation.

2015-12-07 Thread Artem Belevich via cfe-commits
On Mon, Dec 7, 2015 at 3:20 PM, David Blaikie wrote: > Index: lib/AST/RecordLayoutBuilder.cpp >> === >> --- lib/AST/RecordLayoutBuilder.cpp >> +++ lib/AST/RecordLayoutBuilder.cpp >> @@ -1996,6 +1996,16 @@ >>bool allowInlineFuncti

Re: [PATCH] D15309: [CUDA] emit vtables only for classes with methods usable on this side of compilation.

2015-12-07 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 42122. tra added a comment. Removed unnecessary temporary variable and 'else'. http://reviews.llvm.org/D15309 Files: lib/AST/RecordLayoutBuilder.cpp test/CodeGenCUDA/device-vtable.cu Index: test/CodeGenCUDA/device-vtable.cu

Re: [PATCH] D15309: [CUDA] emit vtables only for classes with methods usable on this side of compilation.

2015-12-09 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: test/CodeGenCUDA/device-vtable.cu:36 @@ +35,3 @@ +// only device methods would be available during host or device +// compilation. For now we'll not emit such vtable at all. +class HD { jpienaar wrote: > What is the current

Re: [PATCH] D15309: [CUDA] emit vtables only for classes with methods usable on this side of compilation.

2015-12-09 Thread Artem Belevich via cfe-commits
tra updated the summary for this revision. tra updated this revision to Diff 42341. tra added a comment. Changed key method algorithm to ignore methods that we will not emit during this compilation (previous version didn't allow mixed host/device virtual methods). For vtables with mixed host/de

[PATCH] D15534: [CUDA] renamed cuda_runtime.h wrapper to __cuda_runtime.h

2015-12-15 Thread Artem Belevich via cfe-commits
tra created this revision. tra added a reviewer: echristo. tra added a subscriber: cfe-commits. Currently it's easy to break CUDA compilation by passing "-isystem /path/to/cuda/include" to compiler which leads to compiler including real cuda_runtime.h from there instead of the wrapper we need. Re

Re: [PATCH] D15534: [CUDA] renamed cuda_runtime.h wrapper to __clang_cuda_runtime_wrapper.h

2015-12-15 Thread Artem Belevich via cfe-commits
tra retitled this revision from "[CUDA] renamed cuda_runtime.h wrapper to __cuda_runtime.h" to "[CUDA] renamed cuda_runtime.h wrapper to __clang_cuda_runtime_wrapper.h". tra updated the summary for this revision. tra added a reviewer: chandlerc. tra updated this revision to Diff 42882. tra added

Re: [PATCH] D15534: [CUDA] renamed cuda_runtime.h wrapper to __clang_cuda_runtime_wrapper.h

2015-12-16 Thread Artem Belevich via cfe-commits
tra updated this revision to Diff 43025. tra marked 3 inline comments as done. tra added a comment. Incorporated Chandler's suggestions. Fixed #include_next -> #include. http://reviews.llvm.org/D15534 Files: lib/Driver/ToolChains.cpp lib/Headers/CMakeLists.txt lib/Headers/__clang_cuda_run

Re: [PATCH] D15534: [CUDA] renamed cuda_runtime.h wrapper to __clang_cuda_runtime_wrapper.h

2015-12-16 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Headers/__clang_cuda_runtime_wrapper.h:95 @@ -78,3 +94,3 @@ #define __CUDACC__ #include_next "cuda_runtime.h" jhen wrote: > Now that the name of this header has been changed, would it be appropriate to > change this

r255802 - [CUDA] renamed cuda_runtime.h wrapper to __cuda_runtime.h

2015-12-16 Thread Artem Belevich via cfe-commits
Author: tra Date: Wed Dec 16 12:51:59 2015 New Revision: 255802 URL: http://llvm.org/viewvc/llvm-project?rev=255802&view=rev Log: [CUDA] renamed cuda_runtime.h wrapper to __cuda_runtime.h Currently it's easy to break CUDA compilation by passing "-isystem /path/to/cuda/include" to compiler which l

Re: [PATCH] D15534: [CUDA] renamed cuda_runtime.h wrapper to __clang_cuda_runtime_wrapper.h

2015-12-16 Thread Artem Belevich via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL255802: [CUDA] renamed cuda_runtime.h wrapper to __cuda_runtime.h (authored by tra). Changed prior to commit: http://reviews.llvm.org/D15534?vs=43025&id=43034#toc Repository: rL LLVM http://reviews.

Re: [PATCH] D15305: [CUDA] Do not allow dynamic initialization of global device side variables.

2015-12-16 Thread Artem Belevich via cfe-commits
tra added a comment. Ping. @rsmith -- Richard, can you take a look? http://reviews.llvm.org/D15305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15309: [CUDA] emit vtables only for classes with methods usable on this side of compilation.

2015-12-16 Thread Artem Belevich via cfe-commits
tra added a comment. Ping. @rsmith -- Richard, can you take a look at this change as well? http://reviews.llvm.org/D15309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15596: Add -L/path/to/cuda/lib if any of our inputs are CUDA files.

2015-12-16 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Driver/ToolChains.cpp:4125 @@ +4124,3 @@ + ArgStringList &LDArgs) const { + if (DriverArgs.hasArg(options::OPT_nocudalib) || !CudaInstallation.isValid()) +return; We may need a new option

Re: [PATCH] D15596: Add -L/path/to/cuda/lib if any of our inputs are CUDA files.

2015-12-16 Thread Artem Belevich via cfe-commits
tra added a comment. You also need a test case for the changes. http://reviews.llvm.org/D15596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15596: Add -L/path/to/cuda/lib if any of our inputs are CUDA files.

2015-12-16 Thread Artem Belevich via cfe-commits
tra added inline comments. Comment at: lib/Driver/Tools.cpp:259-261 @@ -249,1 +258,5 @@ + // Add -L/path/to/cuda/lib if any of our inputs are .cu files. + if (std::any_of(C.getActions().begin(), C.getActions().end(), isCudaAction)) { +TC.AddCudaLinkerArgs(Args, CmdArgs); +

r255911 - [CUDA] Make vtable construction aware of host/device side of CUDA compilation.

2015-12-17 Thread Artem Belevich via cfe-commits
Author: tra Date: Thu Dec 17 12:12:36 2015 New Revision: 255911 URL: http://llvm.org/viewvc/llvm-project?rev=255911&view=rev Log: [CUDA] Make vtable construction aware of host/device side of CUDA compilation. C++ emits vtables for classes that have key function present in the current TU. While we

Re: [PATCH] D15309: [CUDA] emit vtables only for classes with methods usable on this side of compilation.

2015-12-17 Thread Artem Belevich via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL255911: [CUDA] Make vtable construction aware of host/device side of CUDA compilation. (authored by tra). Changed prior to commit: http://reviews.llvm.org/D15309?vs=42341&id=43150#toc Repository: rL

r255933 - [CUDA] runtime wrapper header tweaks

2015-12-17 Thread Artem Belevich via cfe-commits
Author: tra Date: Thu Dec 17 16:25:22 2015 New Revision: 255933 URL: http://llvm.org/viewvc/llvm-project?rev=255933&view=rev Log: [CUDA] runtime wrapper header tweaks * Pull in host-only implementations of few CUDA-specific math functions. * #nclude early to prevent its inclusion from CUDA heade

[clang] [HIP] Allow partial linking for `-fgpu-rdc` (PR #81700)

2024-02-14 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B edited https://github.com/llvm/llvm-project/pull/81700 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP] Allow partial linking for `-fgpu-rdc` (PR #81700)

2024-02-14 Thread Artem Belevich via cfe-commits
@@ -36,6 +47,146 @@ static std::string normalizeForBundler(const llvm::Triple &T, : T.normalize(); } +// Collect undefined __hip_fatbin* and __hip_gpubin_handle* symbols from all +// input object or archive files. +class HIPUndefinedFatBinSymbols { +publi

[clang] [HIP] Allow partial linking for `-fgpu-rdc` (PR #81700)

2024-02-14 Thread Artem Belevich via cfe-commits
@@ -36,6 +47,146 @@ static std::string normalizeForBundler(const llvm::Triple &T, : T.normalize(); } +// Collect undefined __hip_fatbin* and __hip_gpubin_handle* symbols from all +// input object or archive files. +class HIPUndefinedFatBinSymbols { +publi

<    3   4   5   6   7   8   9   10   11   12   >