r332619 - [CUDA] Make std::min/max work when compiling in C++14 mode with a C++11 stdlib.

2018-05-17 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Thu May 17 09:12:42 2018 New Revision: 332619 URL: http://llvm.org/viewvc/llvm-project?rev=332619&view=rev Log: [CUDA] Make std::min/max work when compiling in C++14 mode with a C++11 stdlib. Reviewers: rsmith Subscribers: sanjoy, cfe-commits, tra Differential Revision: htt

r332621 - [CUDA] Allow "extern __shared__ Foo foo[]" within anon. namespaces.

2018-05-17 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Thu May 17 09:15:07 2018 New Revision: 332621 URL: http://llvm.org/viewvc/llvm-project?rev=332621&view=rev Log: [CUDA] Allow "extern __shared__ Foo foo[]" within anon. namespaces. Summary: Previously this triggered a -Wundefined-internal warning. But it's not an undefined va

r314142 - Revert "[NVPTX] added match.{any, all}.sync instructions, intrinsics & builtins.", rL314135.

2017-09-25 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Sep 25 12:41:56 2017 New Revision: 314142 URL: http://llvm.org/viewvc/llvm-project?rev=314142&view=rev Log: Revert "[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.", rL314135. Causing assertion failures on macos: > Assertion failed: (Num < NumOpe

Re: [PATCH] D55456: [CUDA] added missing 'inline' for the functions defined in the header.

2018-12-07 Thread Justin Lebar via cfe-commits
Lgtm On Fri, Dec 7, 2018, 1:12 PM Artem Belevich via Phabricator < revi...@reviews.llvm.org> wrote: > tra created this revision. > tra added a reviewer: jlebar. > Herald added subscribers: bixia, sanjoy. > > https://reviews.llvm.org/D55456 > > Files: > clang/lib/Headers/cuda_wrappers/new > > >

Re: [PATCH] D61458: [hip] Relax CUDA call restriction within `decltype` context.

2019-05-02 Thread Justin Lebar via cfe-commits
> So, actually, I wonder if that's not the right answer. We generally allow different overloads to have different return types. What if, for example, the return type on the host is __float128 and on the device it's `MyLongFloatTy`? The problem is that conceptually compiling for host/device does no

Re: [PATCH] D61458: [hip] Relax CUDA call restriction within `decltype` context.

2019-05-02 Thread Justin Lebar via cfe-commits
> In any case, it seems like your examples argue for disallowing a return-type mismatch between host and device overloads, not disallowing observing the type? Oh no, we have to allow return-type mismatches between host and device overloads, that is a common thing in CUDA code I've seen. You can s

r312681 - [CUDA] Add device overloads for non-placement new/delete.

2017-09-06 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Wed Sep 6 17:37:20 2017 New Revision: 312681 URL: http://llvm.org/viewvc/llvm-project?rev=312681&view=rev Log: [CUDA] Add device overloads for non-placement new/delete. Summary: Tests have to live in the test-suite, and so will come in a separate patch. Fixes PR34360. Revi

r312736 - [CUDA] When compilation fails, print the compilation mode.

2017-09-07 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Thu Sep 7 11:37:16 2017 New Revision: 312736 URL: http://llvm.org/viewvc/llvm-project?rev=312736&view=rev Log: [CUDA] When compilation fails, print the compilation mode. Summary: That is, instead of "1 error generated", we now say "1 error generated when compiling for sm_35"

r336026 - [CUDA] Make __host__/__device__ min/max overloads constexpr in C++14.

2018-06-29 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Jun 29 15:28:09 2018 New Revision: 336026 URL: http://llvm.org/viewvc/llvm-project?rev=336026&view=rev Log: [CUDA] Make __host__/__device__ min/max overloads constexpr in C++14. Summary: Tests in a separate change to the test-suite. Reviewers: rsmith, tra Subscribers: l

r336025 - [CUDA] Make min/max shims host+device.

2018-06-29 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Jun 29 15:27:56 2018 New Revision: 336025 URL: http://llvm.org/viewvc/llvm-project?rev=336025&view=rev Log: [CUDA] Make min/max shims host+device. Summary: Fixes PR37753: min/max can't be called from __host__ __device__ functions in C++14 mode. Testcase in a separate tes

Re: [PATCH] D9168: [NVPTX] Check if callsite is defined when computing argument allignment

2016-09-20 Thread Justin Lebar via cfe-commits
jlebar added a subscriber: jlebar. jlebar added a comment. FWIW I have run into this in the past and just not managed to muster up the energy to fix it. So, thank you! https://reviews.llvm.org/D9168 ___ cfe-commits mailing list cfe-commits@lists.l

Re: [PATCH] D9168: [NVPTX] Check if callsite is defined when computing argument allignment

2016-09-20 Thread Justin Lebar via cfe-commits
jlebar added a comment. > I was not able to figure out how to comandeer a revision, so i just went > ahead and pushed it. Under "leap into action", one of the options is to commandeer the revision. https://reviews.llvm.org/D9168 ___ cfe-commits m

[PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rsmith. jlebar added subscribers: cfe-commits, jhen, tra. These cause us to consider all functions in-between to be __host__ __device__. You can nest these pragmas; you just can't have more 'end's than 'begin's. https://reviews.llvm.org/D249

[PATCH] D24978: [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. Herald added subscribers: mgorny, beanz. This matches the idiom we use for our other CUDA wrapper headers. https://reviews.llvm.org/D24978 Files: clang/lib/Frontend/CompilerInvocation.cpp clan

[PATCH] D24977: [CUDA] Declare our __device__ math functions in the same inline namespace as our standard library.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: jhen, cfe-commits. Currently we declare our inline __device__ math functions in namespace std. But libstdc++ and libc++ declare these functions in an inline namespace inside namespace std. We need to match this

[PATCH] D24979: [CUDA] Support and std::min/max on the device.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: cfe-commits, jhen. Herald added subscribers: mgorny, beanz. We do this by wrapping and . Tests are in the test-suite. support to come separately. https://reviews.llvm.org/D24979 Files: clang/lib/Driver/To

Re: [PATCH] D24977: [CUDA] Declare our __device__ math functions in the same inline namespace as our standard library.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar added a comment. > That is way too much knowledge about details of standard library > implementation. Honestly I think this looks a lot scarier than it is. Or, to be specific, I think we are already relying on implementation details much more implicit and fragile than what is explicit

Re: [PATCH] D24979: [CUDA] Support and std::min/max on the device.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar added a comment. > I' personally would prefer to force-include these files. I suspect it will > not change things much as we already include a lot. We have already had bugs filed by users whose root cause was that we #included more things than nvcc #includes. I know exact compatibility

Re: [PATCH] D24946: [CUDA] Added support for CUDA-8

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: lib/Headers/__clang_cuda_runtime_wrapper.h:139 @@ -137,1 +138,3 @@ +// CUDA 8.0.41 relies on __USE_FAST_MATH__ and __CUDA_PREC_DIV's values +// Previous versions used to check thether they are defined or not. Nit, missin

Re: [PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 72717. jlebar marked 2 inline comments as done. jlebar added a comment. Address Richard Smith's review comments: - Change macro format. - Add tests (these Just Worked). https://reviews.llvm.org/D24975 Files: clang/include/clang/Basic/DiagnosticParseKinds.

Re: [PATCH] D24979: [CUDA] Support and std::min/max on the device.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 72719. jlebar added a comment. Herald added a subscriber: mehdi_amini. s/libgcc/runtime/ https://reviews.llvm.org/D24979 Files: clang/lib/Driver/ToolChains.cpp clang/lib/Headers/CMakeLists.txt clang/lib/Headers/__clang_cuda_complex_builtins.h clang/l

Re: [PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 72734. jlebar marked 2 inline comments as done. jlebar added a comment. Address Richard's comments. I'm fairly neutral on whether we want to make it an error not to match all of your "begin" pragmas with "end"s. I checked pragma push_macro, and it looks like

Re: [PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar added a comment. > What happens if there are trailing tokens after the pragma? Added code to make this an error. https://reviews.llvm.org/D24975 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/l

[PATCH] D25036: [CUDA] Disallow exceptions in device code.

2016-09-28 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: jhen, cfe-commits. https://reviews.llvm.org/D25036 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaExprCXX.cpp cla

Re: [PATCH] D25036: [CUDA] Disallow exceptions in device code.

2016-09-28 Thread Justin Lebar via cfe-commits
jlebar marked an inline comment as done. Comment at: clang/lib/Sema/SemaExprCXX.cpp:688 @@ +687,3 @@ + if (getLangOpts().CUDA) +CheckCUDAExceptionExpr(OpLoc, "throw"); + tra wrote: > Do you need/want to check returned result? We could, and we could return Exp

[PATCH] D25050: [CUDA] Disallow variable-length arrays in CUDA device code.

2016-09-28 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: jhen, cfe-commits. https://reviews.llvm.org/D25050 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaType.cpp clang/

r282647 - [CUDA] Disallow variable-length arrays in CUDA device code.

2016-09-28 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Wed Sep 28 17:45:58 2016 New Revision: 282647 URL: http://llvm.org/viewvc/llvm-project?rev=282647&view=rev Log: [CUDA] Disallow variable-length arrays in CUDA device code. Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: https://reviews.llvm.org/D25050

Re: [PATCH] D25050: [CUDA] Disallow variable-length arrays in CUDA device code.

2016-09-28 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282647: [CUDA] Disallow variable-length arrays in CUDA device code. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25050?vs=72914&id=72919#toc Repository: rL LLVM https://r

r282646 - [CUDA] Disallow exceptions in device code.

2016-09-28 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Wed Sep 28 17:45:54 2016 New Revision: 282646 URL: http://llvm.org/viewvc/llvm-project?rev=282646&view=rev Log: [CUDA] Disallow exceptions in device code. Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: https://reviews.llvm.org/D25036 Added: cfe/tr

Re: [PATCH] D25036: [CUDA] Disallow exceptions in device code.

2016-09-28 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. jlebar marked an inline comment as done. Closed by commit rL282646: [CUDA] Disallow exceptions in device code. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25036?vs=72872&id=72918#toc Reposito

Re: [PATCH] D24573: [CUDA] Do a better job at detecting wrong-side calls.

2016-09-28 Thread Justin Lebar via cfe-commits
jlebar added a comment. I'm sorry to put more stuff on your plate, Richard, but you already have context on this, so you may be the best person to review this. Unfortunately people keep hitting the bug fixed here (and being confused), so it's maybe not as much of an edge case as I thought. FW

r282822 - Move UTF functions into namespace llvm.

2016-09-29 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Thu Sep 29 19:38:45 2016 New Revision: 282822 URL: http://llvm.org/viewvc/llvm-project?rev=282822&view=rev Log: Move UTF functions into namespace llvm. Summary: This lets people link against LLVM and their own version of the UTF library. I determined this only affects llvm,

[PATCH] D25103: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. This is ugh, but it makes us compatible with NVCC. Fixes bug 26341. https://reviews.llvm.org/D25103 Files: clang/lib/Parse/ParseExprCXX.cpp clang/test/Parser/lambda-attr.cu Index: clang

[PATCH] D25105: [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: rnk, cfe-commits. NVCC compat. Fixes bug 30567. https://reviews.llvm.org/D25105 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaLambda.cpp clang/test/SemaCUDA/imp

[PATCH] D25103: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73085. jlebar marked an inline comment as done. jlebar added a comment. Don't hallucinate a function declarator. https://reviews.llvm.org/D25103 Files: clang/lib/Parse/ParseExprCXX.cpp clang/test/Parser/lambda-attr.cu Index: clang/test/Parser/lambda-at

r282880 - [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 12:14:53 2016 New Revision: 282880 URL: http://llvm.org/viewvc/llvm-project?rev=282880&view=rev Log: [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created. Summary: NVCC compat. Fixes bug 30567. Reviewers: tra Su

r282879 - [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 12:14:48 2016 New Revision: 282879 URL: http://llvm.org/viewvc/llvm-project?rev=282879&view=rev Log: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...). Summary: This is ugh, but it makes us compatible with NVCC. Fixes bug 26341. Reviewers

r282878 - [CUDA] Add missing comment on Sema::CheckCUDAVLA.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 12:14:44 2016 New Revision: 282878 URL: http://llvm.org/viewvc/llvm-project?rev=282878&view=rev Log: [CUDA] Add missing comment on Sema::CheckCUDAVLA. Modified: cfe/trunk/include/clang/Sema/Sema.h Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm

[PATCH] D25105: [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created.

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282880: [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25105?vs=73073&id=73089#toc Repository:

[PATCH] D25103: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282879: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...). (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25103?vs=73085&id=73088#toc Repository: rL

[PATCH] D25103: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > rnk wrote in ParseExprCXX.cpp:1135 > Does nvcc support __declspec style attributes? Maybe we should check for > those too? nvcc doesn't seem to support __declspec attributes. I have no strong opinion on whether or not we should add them ourselves, though I gues

[PATCH] D25114: [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. There's an overload that we can use to make this a bit cleaner. https://reviews.llvm.org/D25114 Files: clang/lib/Parse/ParseExprCXX.cpp Index: clang/lib/Parse/ParseExprCXX.cpp ===

[PATCH] D25115: [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. This is probably the sane place for the attribute to go, but nvcc specifically rejects it. Other GNU-style attributes are allowed in this position (although judging from the warning it emits fo

r282911 - [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 14:55:55 2016 New Revision: 282911 URL: http://llvm.org/viewvc/llvm-project?rev=282911&view=rev Log: [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'. Summary: This is probably the sane place for the attribute to go, but nvcc sp

r282910 - [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 14:55:48 2016 New Revision: 282910 URL: http://llvm.org/viewvc/llvm-project?rev=282910&view=rev Log: [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas. Summary: There's an overload that we can use to make this a bit cleane

r282912 - [CUDA] Remove incorrect comment in CUDASetLambdaAttrs.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 14:55:59 2016 New Revision: 282912 URL: http://llvm.org/viewvc/llvm-project?rev=282912&view=rev Log: [CUDA] Remove incorrect comment in CUDASetLambdaAttrs. I'd said that nvcc doesn't allow you to add __host__ or __device__ attributes on lambdas in all circumstances

[PATCH] D25115: [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282911: [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25115?vs=73105&id=73123#toc Repository:

[PATCH] D25114: [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282910: [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25114?vs=73104&id=73122#toc Repository:

r282927 - [CUDA] Fix implicit-device-lambda.cu after r282911.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 15:17:37 2016 New Revision: 282927 URL: http://llvm.org/viewvc/llvm-project?rev=282927&view=rev Log: [CUDA] Fix implicit-device-lambda.cu after r282911. This commit added a warning that we're (correctly) hitting in this test. Just ignore it. Modified: cfe/trun

[PATCH] D25125: [CUDA] Disallow 'extern __shared__' variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. https://reviews.llvm.org/D25125 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/extern-shared.cu Index: clang/test/SemaCUDA/e

[PATCH] D25125: [CUDA] Disallow 'extern __shared__' variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73136. jlebar added a comment. Fix typo (and add a test to catch it). https://reviews.llvm.org/D25125 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/bad-attributes.cu clang/test/SemaCUDA/ex

[PATCH] D25129: [CUDA] Disallow __constant__ local variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added reviewers: tra, rnk. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25129 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/bad-attributes.cu Index: clang/test/SemaCUDA/

[PATCH] D25129: [CUDA] Disallow __constant__ local variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > tra wrote in DiagnosticSemaKinds.td:6727 > Nit: Technically they are allowed in namespace scope. That's still a "global variable"? Or do you think calling it such will be confusing? https://reviews.llvm.org/D25129

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. Together these let you easily create diagnostics that - are never emitted for host code - are always emitted for __device__ and __global__ functions, and - are emitted for __host__ __device__ f

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73165. jlebar added a comment. Add CUDADiagIfHostCode(). https://reviews.llvm.org/D25139 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaExprCXX.cpp clang/lib/Se

[PATCH] D25143: [CUDA] Disallow __shared__ variables in host functions.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added reviewers: tra, rnk. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25143 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/bad-attributes.cu Index: clang/test/SemaCUDA/

[PATCH] D25129: [CUDA] Disallow __constant__ local variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > tra wrote in DiagnosticSemaKinds.td:6727 > It's not clear whether you mean global storage class or global namespace. > The code checks for global storage, but error message is could be interpreted > either way, IMO. > > I'll leave phrasing up to you. > It's not

r282985 - [CUDA] Disallow 'extern __shared__' variables.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 18:57:30 2016 New Revision: 282985 URL: http://llvm.org/viewvc/llvm-project?rev=282985&view=rev Log: [CUDA] Disallow 'extern __shared__' variables. Also add a test that we disallow __constant__ __shared__ int x; because it's possible to break this without break

r282986 - [CUDA] Disallow __constant__ local variables.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 18:57:34 2016 New Revision: 282986 URL: http://llvm.org/viewvc/llvm-project?rev=282986&view=rev Log: [CUDA] Disallow __constant__ local variables. Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25129 Modified: c

[PATCH] D25129: [CUDA] Disallow __constant__ local variables.

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282986: [CUDA] Disallow __constant__ local variables. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25129?vs=73139&id=73168#toc Repository: rL LLVM https://reviews.llvm.or

[PATCH] D25125: [CUDA] Disallow 'extern __shared__' variables.

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282985: [CUDA] Disallow 'extern __shared__' variables. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25125?vs=73136&id=73167#toc Repository: rL LLVM https://reviews.llvm.o

r282987 - [CUDA] Harmonize asserts in SemaCUDA, NFC.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 18:57:38 2016 New Revision: 282987 URL: http://llvm.org/viewvc/llvm-project?rev=282987&view=rev Log: [CUDA] Harmonize asserts in SemaCUDA, NFC. Modified: cfe/trunk/lib/Sema/SemaCUDA.cpp Modified: cfe/trunk/lib/Sema/SemaCUDA.cpp URL: http://llvm.org/viewvc/llv

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73171. jlebar added a comment. Tweak API a bit. Now we rely on an implicit conversion to bool. Which is not great, I know, but in practice I think works better than an explicit named function. https://reviews.llvm.org/D25139 Files: clang/include/clang/Ba

[PATCH] D25143: [CUDA] Disallow __shared__ variables in host functions.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73172. jlebar added a comment. Update to new CUDADiagIfHostCode API. https://reviews.llvm.org/D25143 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/bad-attributes.cu Index: clang/test/SemaC

[PATCH] D25150: [CUDA] Allow static variables in __host__ __device__ functions, so long as they're never codegen'ed for device.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added reviewers: tra, rnk. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25150 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDecl.cpp clang/test/SemaCUDA/device-var-init.cu clang/test/SemaCUDA/static-var

r283068 - [CUDA] Allow extern __shared__ on empty-length arrays.

2016-10-02 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sun Oct 2 10:24:50 2016 New Revision: 283068 URL: http://llvm.org/viewvc/llvm-project?rev=283068&view=rev Log: [CUDA] Allow extern __shared__ on empty-length arrays. "extern __shared__ int x[]" is OK. Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp cfe/trunk/test/Sema

[PATCH] D25166: [CUDA] Mark device functions as nounwind.

2016-10-02 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. This prevents clang from emitting 'invoke's and catch statements. Things previously mostly worked thanks to TryToMarkNoThrow() in CodeGenFunction. But this is not a proper IPO, and it doesn't prop

[PATCH] D25166: [CUDA] Mark device functions as nounwind.

2016-10-03 Thread Justin Lebar via cfe-commits
jlebar added a comment. In https://reviews.llvm.org/D25166#559117, @rnk wrote: > It feels like the right thing is to disable EH in device side compilation, > but obviously that won't work because it would reject try/throw in host code. Exactly. > I think instead of doing that, we should make

[PATCH] D24571: [CUDA] Disallow overloading destructors.

2016-10-03 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > rnk wrote in SemaOverload.cpp:1131 > I feel like we should exit early on destructors here, before we do any target > checks. The assert also feels kind of trivial because we only come into this > overload machinery if looking up New's DeclarationName found Old.

r283120 - [CUDA] Disallow overloading destructors.

2016-10-03 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Oct 3 11:48:23 2016 New Revision: 283120 URL: http://llvm.org/viewvc/llvm-project?rev=283120&view=rev Log: [CUDA] Disallow overloading destructors. Summary: We'd attempted to allow this, but turns out we were doing a very bad job. :) Making this work properly would be

r283121 - [CUDA] Clean up some comments in Sema::IsOverload. NFC

2016-10-03 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Oct 3 11:48:27 2016 New Revision: 283121 URL: http://llvm.org/viewvc/llvm-project?rev=283121&view=rev Log: [CUDA] Clean up some comments in Sema::IsOverload. NFC Modified: cfe/trunk/lib/Sema/SemaOverload.cpp Modified: cfe/trunk/lib/Sema/SemaOverload.cpp URL: http:

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-10-03 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73315. jlebar marked an inline comment as done. jlebar added a comment. Address review comments, and rebase atop https://reviews.llvm.org/D24573. https://reviews.llvm.org/D25139 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-10-03 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > rnk wrote in Sema.h:9238 > I'm concerned that this usage pattern isn't going to be efficient because you > build the complete diagnostic before calling the bool conversion operator to > determine that it doesn't need to be emitted. I think you want to construct

[PATCH] D24571: [CUDA] Disallow overloading destructors.

2016-10-04 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283120: [CUDA] Disallow overloading destructors. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24571?vs=71379&id=73413#toc Repository: rL LLVM https://reviews.llvm.org/D24

[PATCH] D25260: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added a subscriber: cfe-commits. This will let us (in a separate patch) allocate deferred diagnostics in the ASTContext's PartialDiagnostic arena. https://reviews.llvm.org/D25260 Files: clang/include/clang/AST/ASTContext.h c

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > rnk wrote in Sema.h:9258 > The ASTContext should outlive IRgen, since the AST is allocated in its arena. > Is there a separate diagnostic memory pool that I don't know about? You're right, this is a silly bug. Fixed in a separate patch, https://reviews.llvm.org

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73576. jlebar marked an inline comment as done. jlebar added a comment. Rebase atop https://reviews.llvm.org/D25260, which obviates the need for this ugly PD allocation dance. https://reviews.llvm.org/D25139 Files: clang/include/clang/Basic/DiagnosticSemaK

[PATCH] D25166: [CUDA] Mark device functions as nounwind.

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73577. jlebar added a comment. Move everything into codegen. https://reviews.llvm.org/D25166 Files: clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGException.cpp clang/test/CodeGenCUDA/convergent.cu clang/test/CodeGenCUDA/device-var-init.cu clang/

[PATCH] D25260: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73578. jlebar added a comment. Update comment. https://reviews.llvm.org/D25260 Files: clang/include/clang/AST/ASTContext.h clang/lib/CodeGen/CodeGenModule.cpp Index: clang/lib/CodeGen/CodeGenModule.cpp ==

[PATCH] D25166: [CUDA] Mark device functions as nounwind.

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73579. jlebar marked an inline comment as done. jlebar added a comment. Update tests. https://reviews.llvm.org/D25166 Files: clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGException.cpp clang/test/CodeGenCUDA/convergent.cu clang/test/CodeGenCUDA/de

r283271 - [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

2016-10-04 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Oct 4 18:41:45 2016 New Revision: 283271 URL: http://llvm.org/viewvc/llvm-project?rev=283271&view=rev Log: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator. Summary: This will let us (in a separate patch) allocate deferr

[PATCH] D25260: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

2016-10-04 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283271: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25260?vs=73578&id=73580#toc Repository: rL LLV

r283272 - [CUDA] Mark device functions as nounwind.

2016-10-04 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Oct 4 18:41:49 2016 New Revision: 283272 URL: http://llvm.org/viewvc/llvm-project?rev=283272&view=rev Log: [CUDA] Mark device functions as nounwind. Summary: This prevents clang from emitting 'invoke's and catch statements. Things previously mostly worked thanks to TryT

[PATCH] D25166: [CUDA] Mark device functions as nounwind.

2016-10-04 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283272: [CUDA] Mark device functions as nounwind. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25166?vs=73579&id=73581#toc Repository: rL LLVM https://reviews.llvm.org/D2

r283280 - [CUDA] Add missing ':' to noexcept.cu test.

2016-10-04 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Oct 4 19:27:38 2016 New Revision: 283280 URL: http://llvm.org/viewvc/llvm-project?rev=283280&view=rev Log: [CUDA] Add missing ':' to noexcept.cu test. Modified: cfe/trunk/test/CodeGenCUDA/nothrow.cu Modified: cfe/trunk/test/CodeGenCUDA/nothrow.cu URL: http://llvm.o

r283487 - [Sema] Replace smart quote with "'" in comment.

2016-10-06 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Thu Oct 6 14:47:56 2016 New Revision: 283487 URL: http://llvm.org/viewvc/llvm-project?rev=283487&view=rev Log: [Sema] Replace smart quote with "'" in comment. Looks like the smart quote was copy/pasted from the C++ standard. The smart quote was not encoded as valid UTF-8 (?

r283637 - [CUDA] Do a better job at detecting wrong-side calls.

2016-10-07 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Oct 7 20:07:11 2016 New Revision: 283637 URL: http://llvm.org/viewvc/llvm-project?rev=283637&view=rev Log: [CUDA] Do a better job at detecting wrong-side calls. Summary: Move CheckCUDACall from ActOnCallExpr and BuildDeclRefExpr to DiagnoseUseOfDecl. This lets us catch

[PATCH] D24573: [CUDA] Do a better job at detecting wrong-side calls.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283637: [CUDA] Do a better job at detecting wrong-side calls. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24573?vs=71381&id=74030#toc Repository: rL LLVM https://reviews

[PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-10-08 Thread Justin Lebar via cfe-commits
jlebar marked 2 inline comments as done. jlebar added a comment. In https://reviews.llvm.org/D24975#565054, @rsmith wrote: > Please add a test to test/PCH for the serialization code. Otherwise, LGTM. Test added. It caught a bug, too. :) Thank you for the review. https://reviews.llvm.org/D

r283678 - [CUDA] Declare our __device__ math functions in the same inline namespace as our standard library.

2016-10-08 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sat Oct 8 17:16:03 2016 New Revision: 283678 URL: http://llvm.org/viewvc/llvm-project?rev=283678&view=rev Log: [CUDA] Declare our __device__ math functions in the same inline namespace as our standard library. Summary: Currently we declare our inline __device__ math functio

r283677 - [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-10-08 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sat Oct 8 17:15:58 2016 New Revision: 283677 URL: http://llvm.org/viewvc/llvm-project?rev=283677&view=rev Log: [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas. Summary: These cause us to consider all functions in-between to be __host__ __device__. You ca

[PATCH] D24977: [CUDA] Declare our __device__ math functions in the same inline namespace as our standard library.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283678: [CUDA] Declare our __device__ math functions in the same inline namespace as… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24977?vs=72684&id=74052#toc Repository:

[PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283677: [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24975?vs=72734&id=74051#toc Repository: rL LLVM

r283679 - [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.

2016-10-08 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sat Oct 8 17:16:08 2016 New Revision: 283679 URL: http://llvm.org/viewvc/llvm-project?rev=283679&view=rev Log: [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h. Summary: This matches the idiom we use for our other CUDA wrapper headers. Reviewers: tra Subscr

r283680 - [CUDA] Support and std::min/max on the device.

2016-10-08 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sat Oct 8 17:16:12 2016 New Revision: 283680 URL: http://llvm.org/viewvc/llvm-project?rev=283680&view=rev Log: [CUDA] Support and std::min/max on the device. Summary: We do this by wrapping and . Tests are in the test-suite. Reviewers: tra Subscribers: jhen, beanz, cfe-

[PATCH] D24978: [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283679: [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24978?vs=72685&id=74054#toc Repository: rL LLVM htt

[PATCH] D24979: [CUDA] Support and std::min/max on the device.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283680: [CUDA] Support and std::min/max on the device. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24979?vs=72719&id=74053#toc Repository: rL LLVM https://reviews.llvm.

Re: r283680 - [CUDA] Support and std::min/max on the device.

2016-10-08 Thread Justin Lebar via cfe-commits
s get > optimized away. Can you please check that they do? If not, you might mirror > what I've done in r283051 for libc++, which is similar to what libstdc++ ends > up doing, so that we use __builtin_isnan/isinf/isfinite. > > Thanks again, > Hal > > - Original M

r283683 - [CUDA] Don't install cuda_wrappers/{algorithm, complex} into the main include dir.

2016-10-08 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sat Oct 8 19:27:39 2016 New Revision: 283683 URL: http://llvm.org/viewvc/llvm-project?rev=283683&view=rev Log: [CUDA] Don't install cuda_wrappers/{algorithm,complex} into the main include dir. This is obviously wrong -- if we do this, then all compiles will pick up these wr

Re: r283680 - [CUDA] Support and std::min/max on the device.

2016-10-08 Thread Justin Lebar via cfe-commits
rg/g/vZB55a >> >> By the way, the changes you made to libc++ unfortunately break this >> patch with libc++, because e.g. __libcpp_isnan is not a device >> function. I'll have to think about how to fix that -- I may send you >> a patch. >> >> Regards, >&

  1   2   3   4   5   6   7   8   9   >