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] 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] 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

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] 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 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] 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] 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] 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

[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

[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] 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] 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

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

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] D24640: [CUDA] Don't try to run sanitizers on NVPTX.

2016-09-15 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL281680: [CUDA] Don't try to run sanitizers on NVPTX. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24640?vs=71572&id=71573#toc Repository: rL LLVM https://reviews.llvm.org

r281680 - [CUDA] Don't try to run sanitizers on NVPTX.

2016-09-15 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Thu Sep 15 18:44:13 2016 New Revision: 281680 URL: http://llvm.org/viewvc/llvm-project?rev=281680&view=rev Log: [CUDA] Don't try to run sanitizers on NVPTX. Summary: Sanitizers aren't supported on NVPTX -- don't try to run them. This lets you e.g. pass -fsanitize=address and

[PATCH] D24640: [CUDA] Don't try to run sanitizers on NVPTX.

2016-09-15 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: kcc. jlebar added subscribers: jhen, tra, cfe-commits. Sanitizers aren't supported on NVPTX -- don't try to run them. This lets you e.g. pass -fsanitize=address and get asan on your host code. https://reviews.llvm.org/D24640 Files: clang/

Re: [PATCH] D24590: [test-suite] [CUDA] Update README.

2016-09-14 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL281552: [test-suite] [CUDA] Update README. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24590?vs=71445&id=71457#toc Repository: rL LLVM https://reviews.llvm.org/D24590 F

Re: [PATCH] D24590: [test-suite] [CUDA] Update README.

2016-09-14 Thread Justin Lebar via cfe-commits
jlebar marked an inline comment as done. jlebar added a comment. Will add. Thank you for the reviews! https://reviews.llvm.org/D24590 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24588: [CUDA] Make __clang_cuda_cmath.h compatible with libc++.

2016-09-14 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL281544: [CUDA] Make __clang_cuda_cmath.h compatible with libc++. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24588?vs=71443&id=71447#toc Repository: rL LLVM https://revi

Re: [PATCH] D24581: [CUDA] Add test checking our ability to take a function pointer to a __global__ function on the host side.

2016-09-14 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL281543: [CUDA] Add test checking our ability to take a function pointer to a… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24581?vs=71423&id=71446#toc Repository: rL LLVM

r281543 - [CUDA] Add test checking our ability to take a function pointer to a __global__ function on the host side.

2016-09-14 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Wed Sep 14 16:50:11 2016 New Revision: 281543 URL: http://llvm.org/viewvc/llvm-project?rev=281543&view=rev Log: [CUDA] Add test checking our ability to take a function pointer to a __global__ function on the host side. Summary: This functionality is used by Thrust. Reviewer

r281544 - [CUDA] Make __clang_cuda_cmath.h compatible with libc++.

2016-09-14 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Wed Sep 14 16:50:14 2016 New Revision: 281544 URL: http://llvm.org/viewvc/llvm-project?rev=281544&view=rev Log: [CUDA] Make __clang_cuda_cmath.h compatible with libc++. Summary: We need to add a bunch more "using"s, which weren't necessary with libstdc++. Once this is in I c

[PATCH] D24590: [test-suite] [CUDA] Update README.

2016-09-14 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. Fix typo (s/Externals/External/), and mention cuda-tests-simple. https://reviews.llvm.org/D24590 Files: External/CUDA/README Index: External/CUDA/README

[PATCH] D24588: [CUDA] Make __clang_cuda_cmath.h compatible with libc++.

2016-09-14 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. We need to add a bunch more "using"s, which weren't necessary with libstdc++. Once this is in I can check in a test to the test-suite. https://reviews.llvm.org/D24588 Files: clang/lib/Headers/_

[PATCH] D24581: [CUDA] Add test checking our ability to take a function pointer to a __global__ function on the host side.

2016-09-14 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. This functionality is used by Thrust. https://reviews.llvm.org/D24581 Files: clang/test/SemaCUDA/reference-to-kernel-fn.cu Index: clang/test/SemaCUDA/reference-to-kernel-fn.cu =

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

2016-09-14 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rsmith. jlebar added subscribers: tra, cfe-commits. Move CheckCUDACall from ActOnCallExpr and BuildDeclRefExpr to DiagnoseUseOfDecl. This lets us catch some edge cases we were missing, specifically around class operators. This necessitates a

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

2016-09-14 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rsmith. jlebar added subscribers: tra, cfe-commits. We'd attempted to allow this, but turns out we were doing a very bad job. :) Making this work properly would be a giant change in clang. For example, we'd need to make CXXRecordDecl::getDe

Re: [PATCH] D24522: [CUDA] Do not merge CUDA target attributes.

2016-09-13 Thread Justin Lebar via cfe-commits
jlebar accepted this revision. jlebar added a comment. This revision is now accepted and ready to land. Yay, this is great. Comment at: test/SemaCUDA/target_attr_inheritance.cu:4 @@ +3,3 @@ +// REQUIRES: x86-registered-target +// REQUIRES: nvptx-registered-target + -

Re: [PATCH] D24407: [CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device.

2016-09-09 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL281089: [CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24407?vs=70857&id=70895#toc Repository: rL LLVM

r281089 - [CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device.

2016-09-09 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 9 15:35:43 2016 New Revision: 281089 URL: http://llvm.org/viewvc/llvm-project?rev=281089&view=rev Log: [CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device. Summary: This fixes a bug where we were unable to compile the following CUDA file with libstd

[PATCH] D24407: [CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device.

2016-09-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: jhen, cfe-commits. This fixes a bug where we were unable to compile the following CUDA file with libstdc++ (didn't try libc++): #include void foo() { std::shared_future x; } The problem is that only defin

Re: [PATCH] D23627: [CUDA] Improve handling of math functions.

2016-08-18 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL279140: [CUDA] Improve handling of math functions. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D23627?vs=68427&id=68600#toc Repository: rL LLVM https://reviews.llvm.org/D

r279140 - [CUDA] Improve handling of math functions.

2016-08-18 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Thu Aug 18 15:43:13 2016 New Revision: 279140 URL: http://llvm.org/viewvc/llvm-project?rev=279140&view=rev Log: [CUDA] Improve handling of math functions. Summary: A bunch of related changes here to our CUDA math headers. - The second arg to nexttoward is a double (well, tec

Re: [PATCH] D23627: [CUDA] Improve handling of math functions.

2016-08-18 Thread Justin Lebar via cfe-commits
jlebar added a comment. These changes have always been kind of scary. tra tested this against Thrust all combinations of CUDA 7.0/7.5, c++98/11, libc++/libstdc++{4.8.5/4.9.3,5.3.0}. So we should be good here. I hope. https://reviews.llvm.org/D23627 ___

Re: [PATCH] D23627: [CUDA] Improve handling of math functions.

2016-08-17 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: clang/lib/Headers/__clang_cuda_cmath.h:125-133 @@ -122,8 +124,11 @@ __DEVICE__ float modf(float __x, float *__iptr) { return ::modff(__x, __iptr); } -__DEVICE__ float nexttoward(float __from, float __to) { +__DEVICE__ float nexttoward(fl

[PATCH] D23627: [CUDA] Improve handling of math functions.

2016-08-17 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. A bunch of related changes here to our CUDA math headers. - The second arg to nexttoward is a double (well, technically, long double, but we don't have that), not a float. - Add a forward-declar

r278767 - [CUDA] Fix "declared here" note on deferred wrong-side errors.

2016-08-15 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Aug 15 19:48:21 2016 New Revision: 278767 URL: http://llvm.org/viewvc/llvm-project?rev=278767&view=rev Log: [CUDA] Fix "declared here" note on deferred wrong-side errors. Previously we weren't deferring these "declared here" notes, which is obviously wrong. Modified:

Re: [PATCH] D23242: [CUDA] Raise an error if a wrong-side call is codegen'ed.

2016-08-15 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278759: [CUDA] Raise an error if a wrong-side call is codegen'ed. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D23242?vs=67378&id=68103#toc Repository: rL LLVM https://rev

r278759 - [CUDA] Raise an error if a wrong-side call is codegen'ed.

2016-08-15 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Aug 15 18:00:49 2016 New Revision: 278759 URL: http://llvm.org/viewvc/llvm-project?rev=278759&view=rev Log: [CUDA] Raise an error if a wrong-side call is codegen'ed. Summary: Some function calls in CUDA are allowed to appear in semantically-correct programs but are an err

Re: [PATCH] D23526: [CUDA] Collapsed offload actions should not be top-level jobs.

2016-08-15 Thread Justin Lebar via cfe-commits
jlebar added a comment. Wow, I have no idea if this is right. I can try to figure it out, but if sfantao can review, that's easier. Comment at: test/Driver/cuda-bindings.cu:10 @@ +9,3 @@ +// way. Instead we check whether we've generated a permanent name on +// device side whic

Re: [PATCH] D23241: Add the notion of deferred diagnostics.

2016-08-15 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278735: Add the notion of deferred diagnostics. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D23241?vs=68063&id=68073#toc Repository: rL LLVM https://reviews.llvm.org/D232

Re: [PATCH] D23341: [CUDA] Include CUDA headers before anything else.

2016-08-15 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278734: [CUDA] Include CUDA headers before anything else. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D23341?vs=67439&id=68072#toc Repository: rL LLVM https://reviews.llv

Re: [PATCH] D23340: [CUDA] Fix CUDA install version parsing.

2016-08-15 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278733: [CUDA] Fix CUDA install version parsing. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D23340?vs=67438&id=68071#toc Repository: rL LLVM https://reviews.llvm.org/D23

r278734 - [CUDA] Include CUDA headers before anything else.

2016-08-15 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Aug 15 15:38:52 2016 New Revision: 278734 URL: http://llvm.org/viewvc/llvm-project?rev=278734&view=rev Log: [CUDA] Include CUDA headers before anything else. Summary: There's no point to --cuda-path if we then go and include /usr/include first. And if you install the rig

r278735 - Add the notion of deferred diagnostics.

2016-08-15 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Aug 15 15:38:56 2016 New Revision: 278735 URL: http://llvm.org/viewvc/llvm-project?rev=278735&view=rev Log: Add the notion of deferred diagnostics. Summary: This patch lets you create diagnostics that are emitted if and only if a particular FunctionDecl is codegen'ed. Th

r278733 - [CUDA] Fix CUDA install version parsing.

2016-08-15 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Aug 15 15:38:48 2016 New Revision: 278733 URL: http://llvm.org/viewvc/llvm-project?rev=278733&view=rev Log: [CUDA] Fix CUDA install version parsing. Summary: getAsInteger returns true on error. Oops. No test because the behavior at the moment is identical with or withou

Re: [PATCH] D23241: Add the notion of deferred diagnostics.

2016-08-15 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 68063. jlebar added a comment. Move deferred diags storage into ASTContext. https://reviews.llvm.org/D23241 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/Decl.h clang/lib/AST/Decl.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/

Re: [PATCH] D23429: [CUDA] Place GPU binary into .nv_fatbin section and align it by 8.

2016-08-11 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:62 @@ -60,2 +61,3 @@ llvm::ConstantInt::get(SizeTy, 0)}; -auto ConstStr = CGM.GetAddrOfConstantCString(Str, Name.c_str()); +auto ConstStr = CGM.GetAddrOfConstantCString(Str,

Re: [PATCH] D23239: [CUDA] Add __device__ overloads for placement new and delete.

2016-08-09 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278194: [CUDA] Add __device__ overloads for placement new and delete. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D23239?vs=67282&id=67447#toc Repository: rL LLVM https:/

Re: [PATCH] D23240: [CUDA] Print a "previous-decl" note when calling an illegal member fn.

2016-08-09 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278195: [CUDA] Print a "previous-decl" note when calling an illegal member fn. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D23240?vs=67081&id=67448#toc Repository: rL LLVM

Re: [PATCH] D23335: [CUDA] Reject calls to __device__ functions from host variable global initializers.

2016-08-09 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278196: [CUDA] Reject calls to __device__ functions from host variable global… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D23335?vs=67435&id=67449#toc Repository: rL LLVM

r278196 - [CUDA] Reject calls to __device__ functions from host variable global initializers.

2016-08-09 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Aug 9 20:09:21 2016 New Revision: 278196 URL: http://llvm.org/viewvc/llvm-project?rev=278196&view=rev Log: [CUDA] Reject calls to __device__ functions from host variable global initializers. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://review

r278193 - [CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC

2016-08-09 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Aug 9 20:09:11 2016 New Revision: 278193 URL: http://llvm.org/viewvc/llvm-project?rev=278193&view=rev Log: [CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC Summary: I want to reuse "CheckCUDAFoo" in a later patch. Also, I think IsAllowedCUDACall gets the point ac

r278192 - [Diag] Fix idiom in comment: "on the lam", not "on the lamb".

2016-08-09 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Aug 9 20:09:07 2016 New Revision: 278192 URL: http://llvm.org/viewvc/llvm-project?rev=278192&view=rev Log: [Diag] Fix idiom in comment: "on the lam", not "on the lamb". Modified: cfe/trunk/lib/Basic/Diagnostic.cpp Modified: cfe/trunk/lib/Basic/Diagnostic.cpp URL: h

r278194 - [CUDA] Add __device__ overloads for placement new and delete.

2016-08-09 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Aug 9 20:09:14 2016 New Revision: 278194 URL: http://llvm.org/viewvc/llvm-project?rev=278194&view=rev Log: [CUDA] Add __device__ overloads for placement new and delete. Summary: Previously these sort of worked because they didn't end up resulting in calls at the ptx laye

r278195 - [CUDA] Print a "previous-decl" note when calling an illegal member fn.

2016-08-09 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Aug 9 20:09:18 2016 New Revision: 278195 URL: http://llvm.org/viewvc/llvm-project?rev=278195&view=rev Log: [CUDA] Print a "previous-decl" note when calling an illegal member fn. Summary: When we emit err_ref_bad_target, we should emit a "'method' declared here" note. We

Re: [PATCH] D23238: [CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC

2016-08-09 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278193: [CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D23238?vs=67079&id=67446#toc Repository: rL LLVM https://revie

r278183 - [CUDA] Minor comment nits.

2016-08-09 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Aug 9 19:40:43 2016 New Revision: 278183 URL: http://llvm.org/viewvc/llvm-project?rev=278183&view=rev Log: [CUDA] Minor comment nits. Modified: cfe/trunk/lib/Sema/SemaOverload.cpp Modified: cfe/trunk/lib/Sema/SemaOverload.cpp URL: http://llvm.org/viewvc/llvm-projec

r278184 - [CUDA] Fix out-of-date comment.

2016-08-09 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Aug 9 19:40:46 2016 New Revision: 278184 URL: http://llvm.org/viewvc/llvm-project?rev=278184&view=rev Log: [CUDA] Fix out-of-date comment. LangOpts.CUDADisableTargetCallChecks no longer exists (it's effectively always true now). Modified: cfe/trunk/include/clang/Sem

[PATCH] D23341: [CUDA] Include CUDA headers before anything else.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: Prazek, cfe-commits. There's no point to --cuda-path if we then go and include /usr/include first. And if you install the right packages, Ubuntu will install (very old) CUDA headers there. https://reviews.llvm.

[PATCH] D23340: [CUDA] Fix CUDA install version parsing.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: Prazek, cfe-commits. getAsInteger returns true on error. Oops. No test because the behavior at the moment is identical with or without this change. https://reviews.llvm.org/D23340 Files: clang/lib/Driver/To

Re: [PATCH] D23335: [CUDA] Reject calls to __device__ functions from host variable global initializers.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 67435. jlebar marked an inline comment as done. jlebar added a comment. Test tweak per review. https://reviews.llvm.org/D23335 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDecl.cpp clang/test/SemaCUDA/global-initializers-h

Re: [PATCH] D23335: [CUDA] Reject calls to __device__ functions from host variable global initializers.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: clang/test/SemaCUDA/global-initializers-host.cu:2 @@ +1,3 @@ +// RUN: %clang_cc1 %s --std=c++11 -triple x86_64-linux-unknown -emit-llvm -o - -verify + +#include "Inputs/cuda.h" tra wrote: > I'd add the same comment as in

[PATCH] D23335: [CUDA] Reject calls to __device__ functions from host variable global initializers.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D23335 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDecl.cpp clang/test/SemaCUDA/call-device-fn-from-host.cu clang/test/SemaCUDA/globa

Re: [PATCH] D23242: [CUDA] Raise an error if a wrong-side call is codegen'ed.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar added a comment. > Hm, these seem completely broken, before and after this patch. I'll handle it > separately if that's OK. https://reviews.llvm.org/D23335. The device side equivalent works afaict (and is very well-tested). https://reviews.llvm.org/D23242 _

Re: [PATCH] D23242: [CUDA] Raise an error if a wrong-side call is codegen'ed.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 67378. jlebar added a comment. Address review comments. Also swap the two tests -- I had the wrong names on them. https://reviews.llvm.org/D23242 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaDeclCXX.cpp clang

Re: [PATCH] D23242: [CUDA] Raise an error if a wrong-side call is codegen'ed.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar marked 3 inline comments as done. jlebar added a comment. > Should be add few tests for calling device functions from host-side global > initializers? Perhaps for device->host, too, as there may be unexpected > interplay with constructor emptiness checks. Hm, these seem completely broke

Re: [PATCH] D23241: Add the notion of deferred diagnostics.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar added a comment. Reid, I'd still like you to have a look at this one if you don't mind, since it's outside my and Art's core competencies. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2886 @@ +2885,3 @@ + // Check if this function has diagnostics that should be emitt

Re: [PATCH] D23241: Add the notion of deferred diagnostics.

2016-08-09 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 67367. jlebar marked an inline comment as done. jlebar added a comment. Address review comments, and don't abort codegen'ing a function if it has only deferred warnings -- check specifically for errors. https://reviews.llvm.org/D23241 Files: clang/include/

Re: [PATCH] D23239: [CUDA] Add __device__ overloads for placement new and delete.

2016-08-08 Thread Justin Lebar via cfe-commits
jlebar added a comment. In https://reviews.llvm.org/D23239#508863, @tra wrote: > I think we need to add `noexcept` for these in c++11. Argh, you are completely right. Thank you for the review. https://reviews.llvm.org/D23239 ___ cfe-commits mail

Re: [PATCH] D23239: [CUDA] Add __device__ overloads for placement new and delete.

2016-08-08 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 67282. jlebar added a comment. Add noexcept. https://reviews.llvm.org/D23239 Files: clang/lib/Headers/__clang_cuda_runtime_wrapper.h Index: clang/lib/Headers/__clang_cuda_runtime_wrapper.h ==

[PATCH] D23242: [CUDA] Raise an error if a wrong-side call is codegen'ed.

2016-08-06 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added reviewers: tra, rnk. jlebar added a subscriber: cfe-commits. Some function calls in CUDA are allowed to appear in semantically-correct programs but are an error if they're ever codegen'ed. Specifically, a host+device function may call a host function, bu

[PATCH] D23241: Add the notion of deferred diagnostics.

2016-08-06 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. This patch lets you create diagnostics that are emitted if and only if a particular FunctionDecl is codegen'ed. This is necessary for CUDA, where some constructs -- e.g. calls from host+device

[PATCH] D23240: [CUDA] Print a "previous-decl" note when calling an illegal member fn.

2016-08-06 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. When we emit err_ref_bad_target, we should emit a "'method' declared here" note. We already do so in most places, just not in BuildCallToMemberFunction. https://reviews.llvm.org/D23240 Files: c

[PATCH] D23238: [CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC

2016-08-06 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. I want to reuse "CheckCUDAFoo" in a later patch. Also, I think IsAllowedCUDACall gets the point across more clearly. https://reviews.llvm.org/D23238 Files: clang/include/clang/Sema/Sema.h cla

[PATCH] D23239: [CUDA] Add __device__ overloads for placement new and delete.

2016-08-06 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. Previously these sort of worked because they didn't end up resulting in calls at the ptx layer. But I'm adding stricter checks that break placement new without these changes. https://reviews.llvm.

Re: [PATCH] D23042: [CUDA] Do not allow using NVPTX target for host compilation.

2016-08-02 Thread Justin Lebar via cfe-commits
jlebar accepted this revision. jlebar added a comment. This revision is now accepted and ready to land. > Restore assertions for presence of -march flag. We don't need an explicit assertion in TranslateArgs? Comment at: lib/Driver/Driver.cpp:1412 @@ +1411,3 @@ + assert(HostTC

Re: [PATCH] D23042: [CUDA] Do not allow using NVPTX target for host compilation.

2016-08-01 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: lib/Driver/ToolChains.cpp:4834 @@ -4831,2 +4833,3 @@ +getDriver().Diag(diag::err_drv_cuda_nvptx_host); } return DAL; IRL we talked about putting an assert() here and bailing out earlier. Does that not work? My

Re: [PATCH] D23037: [CUDA] Fix libdevice selection.

2016-08-01 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: lib/Driver/ToolChains.cpp:4773 @@ +4772,3 @@ + StringRef GpuArch = + DriverArgs.getLastArgValue(options::OPT_march_EQ, "sm_20"); + std::string LibDeviceFile = CudaInstallation.getLibDeviceFile(GpuArch); Hm. I total

Re: [PATCH] D23037: [CUDA] Fix libdevice selection.

2016-08-01 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: lib/Driver/ToolChains.cpp:4773 @@ +4772,3 @@ + StringRef GpuArch = + DriverArgs.getLastArgValue(options::OPT_march_EQ, "sm_20"); + std::string LibDeviceFile = CudaInstallation.getLibDeviceFile(GpuArch); I *think* ma

r277113 - [Typo police] s/proccess/process/, s/auxiliary/auxilliary/.

2016-07-28 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Jul 29 00:26:58 2016 New Revision: 277113 URL: http://llvm.org/viewvc/llvm-project?rev=277113&view=rev Log: [Typo police] s/proccess/process/, s/auxiliary/auxilliary/. Modified: cfe/trunk/include/clang/AST/Decl.h Modified: cfe/trunk/include/clang/AST/Decl.h URL: htt

[clang-tools-extra] r277113 - [Typo police] s/proccess/process/, s/auxiliary/auxilliary/.

2016-07-28 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Jul 29 00:26:58 2016 New Revision: 277113 URL: http://llvm.org/viewvc/llvm-project?rev=277113&view=rev Log: [Typo police] s/proccess/process/, s/auxiliary/auxilliary/. Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp Modified: clang-tools-

Re: [PATCH] D22879: [CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment.

2016-07-27 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL276927: [CUDA] Align kernel launch args correctly when the LLVM type's alignment is… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D22879?vs=65800&id=65824#toc Repository: r

r276927 - [CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment.

2016-07-27 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Wed Jul 27 17:36:21 2016 New Revision: 276927 URL: http://llvm.org/viewvc/llvm-project?rev=276927&view=rev Log: [CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment. Summary: Before this patch, we computed the

r276925 - Don't crash when generating code for __attribute__((naked)) member functions.

2016-07-27 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Wed Jul 27 17:04:24 2016 New Revision: 276925 URL: http://llvm.org/viewvc/llvm-project?rev=276925&view=rev Log: Don't crash when generating code for __attribute__((naked)) member functions. Summary: Previously this crashed inside EmitThisParam(). There should be no prelude f

Re: [PATCH] D22879: [CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment.

2016-07-27 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: test/CodeGenCUDA/kernel-args-alignment.cu:1-2 @@ +1,3 @@ +// REQUIRES: x86-registered-target +// REQUIRES: nvptx-registered-target + rnk wrote: > Typically clang doesn't need a registered backend for a target to generate I

Re: [PATCH] D22879: [CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment.

2016-07-27 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 65800. jlebar added a comment. Remove REQUIRES lines. https://reviews.llvm.org/D22879 Files: lib/CodeGen/CGCUDABuiltin.cpp lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/kernel-args-alignment.cu Index: test/CodeGenCUDA/kernel-args-alignment.cu

[PATCH] D22879: [CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment.

2016-07-27 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. Before this patch, we computed the offsets in memory of args passed to GPU kernel functions by throwing all of the args into an LLVM struct. clang emits packed llvm structs basically whenever i

Re: [PATCH] D22463: [RFC] Moving to GitHub Proposal: NOT DECISION!

2016-07-25 Thread Justin Lebar via cfe-commits
jlebar added a comment. In https://reviews.llvm.org/D22463#495211, @vladisld wrote: > In https://reviews.llvm.org/D22463#494828, @jlebar wrote: > > > I think the general feeling is that most of us (myself included) would > > rather not learn a new tool if there's a simpler >alternative, such as

Re: [PATCH] D22463: [RFC] Moving to GitHub Proposal: NOT DECISION!

2016-07-25 Thread Justin Lebar via cfe-commits
jlebar added a comment. In https://reviews.llvm.org/D22463#494568, @vladisld wrote: > Have the alternatives to sub-modules and monolithic repository been discussed > ? Hi, Vlad. Please see the ongoing thread in llvm-dev, entitled "[RFC] One or many git repositories?". Tools such as git-repo

Re: [PATCH] D22463: [RFC] Moving to GitHub Proposal: NOT DECISION!

2016-07-20 Thread Justin Lebar via cfe-commits
jlebar added a comment. Hi, Renato. Just to explain why I'm going to go forward with this RFC about a monolithic repository: From speaking with some top contributors on IRC, I have heard that they feel that the discussion of whether to move to git has been conflated with the discussion of how

Re: [PATCH] D22463: [RFC] Moving to GitHub Proposal: NOT DECISION!

2016-07-20 Thread Justin Lebar via cfe-commits
jlebar added a comment. In https://reviews.llvm.org/D22463#489461, @rengolin wrote: > You will not be required to use submodules at all, as we'll all use the > individual projects, like we have always been. I don't understand why people > keep going back to it. There is a key use case that is

Re: [PATCH] D22463: [RFC] Moving to GitHub Proposal: NOT DECISION!

2016-07-19 Thread Justin Lebar via cfe-commits
jlebar added a comment. FYI after talking to Chandler, I'm going to write up a separate proposal for the one-repository thing and send it to the list tomorrow. The suggestion was that this phabricator thread isn't the right place to have this discussion. https://reviews.llvm.org/D22463 ___

Re: [PATCH] D22463: [RFC] Moving to GitHub Proposal: NOT DECISION!

2016-07-19 Thread Justin Lebar via cfe-commits
jlebar added a subscriber: jlebar. jlebar added a comment. I'm sure you all have thought about this more than I have, and I apologize if this has been brought up before because I haven't been following the thread closely. But I am not convinced by this document that using subrepositories beats

Re: [PATCH] D21913: [CUDA] Add additional testcases for EraseUnwantedCUDAMatches.

2016-07-12 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL275232: [CUDA] Add additional testcases for EraseUnwantedCUDAMatches. (authored by jlebar). Changed prior to commit: http://reviews.llvm.org/D21913?vs=62445&id=63750#toc Repository: rL LLVM http://r

Re: [PATCH] D21914: [CUDA] Use the multi-element remove function in EraseUnwantedCUDAMatches.

2016-07-12 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL275233: [CUDA] Use the multi-element remove function in EraseUnwantedCUDAMatches. (authored by jlebar). Changed prior to commit: http://reviews.llvm.org/D21914?vs=62446&id=63751#toc Repository: rL LL

r275233 - [CUDA] Use the multi-element remove function in EraseUnwantedCUDAMatches.

2016-07-12 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Jul 12 18:23:13 2016 New Revision: 275233 URL: http://llvm.org/viewvc/llvm-project?rev=275233&view=rev Log: [CUDA] Use the multi-element remove function in EraseUnwantedCUDAMatches. Summary: Bug pointed out by Benjamin Kramer in r264008. I think the bug is benign because

Re: [PATCH] D21912: [CUDA] Don't assume that destructors can't be overloaded.

2016-07-12 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL275231: [CUDA] Don't assume that destructors can't be overloaded. (authored by jlebar). Changed prior to commit: http://reviews.llvm.org/D21912?vs=62444&id=63749#toc Repository: rL LLVM http://revie

<    1   2   3   4   5   6   7   8   9   >