Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-06-23 Thread Jan Vesely via cfe-commits
jvesely added a comment. In http://reviews.llvm.org/D19932#465807, @yaxunl wrote: > > this is not true. as I pointed out earlier, take a look at libclc headers. > > a lot functions are defined for multiple types while maintaining type > > safety. > > > there is no problem having TYPE * to_glob

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-06-23 Thread Yaxun Liu via cfe-commits
yaxunl added a comment. > this is not true. as I pointed out earlier, take a look at libclc headers. a > lot functions are defined for multiple types while maintaining type safety. > there is no problem having TYPE * to_global(TYPE *), for every permissible > CLC type, declared in headers with

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-06-23 Thread Jan Vesely via cfe-commits
jvesely added a comment. In http://reviews.llvm.org/D19932#465784, @yaxunl wrote: > In http://reviews.llvm.org/D19932#465781, @jvesely wrote: > > > In http://reviews.llvm.org/D19932#465763, @cfe-commits wrote: > > > > > The returned pointer should point to the same pointee type as the > > > argu

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-06-23 Thread Yaxun Liu via cfe-commits
yaxunl added a comment. In http://reviews.llvm.org/D19932#465781, @jvesely wrote: > In http://reviews.llvm.org/D19932#465763, @cfe-commits wrote: > > > The returned pointer should point to the same pointee type as the argument. > > Header file cannot guarantee that. > > > > Sam > > > how come? i

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-06-23 Thread Jan Vesely via cfe-commits
jvesely added a comment. In http://reviews.llvm.org/D19932#465763, @cfe-commits wrote: > The returned pointer should point to the same pointee type as the argument. > Header file cannot guarantee that. > > Sam how come? is there a possibility to have two different types using the same name?

RE: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-06-23 Thread Liu, Yaxun (Sam) via cfe-commits
...@arm.com Cc: jan.ves...@rutgers.edu; Stellard, Thomas ; cfe-commits@lists.llvm.org Subject: Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions. jvesely added a subscriber: jvesely. jvesely added a comment. Why couldn't this be declared in CLC header? There are mul

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-06-22 Thread Jan Vesely via cfe-commits
jvesely added a subscriber: jvesely. jvesely added a comment. Why couldn't this be declared in CLC header? There are multiple instances of declaring functions for all available types in libclc (see for example convert functions in convert.h). Repository: rL LLVM http://reviews.llvm.org/D199

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-20 Thread Yaxun Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL270261: [OpenCL] Add to_{global|local|private} builtin functions. (authored by yaxunl). Changed prior to commit: http://reviews.llvm.org/D19932?vs=57478&id=57972#toc Repository: rL LLVM http://revie

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-20 Thread Anastasia Stulova via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. LGTM! Thanks! http://reviews.llvm.org/D19932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-17 Thread Yaxun Liu via cfe-commits
yaxunl updated this revision to Diff 57478. yaxunl marked 8 inline comments as done. yaxunl added a comment. Revised as Anastasia suggested. http://reviews.llvm.org/D19932 Files: include/clang/Basic/Builtins.def include/clang/Basic/DiagnosticSemaKinds.td lib/CodeGen/CGBuiltin.cpp lib/Se

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-12 Thread Anastasia Stulova via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:501 @@ -500,1 +500,3 @@ def err_builtin_needs_feature : Error<"%0 needs target feature %1">; +def err_builtin_needs_opencl_version +: Error<"%0 needs OpenCL version %1%select{| or above}2"

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-12 Thread Xiuli PAN via cfe-commits
pxli168 accepted this revision. pxli168 added a comment. This revision is now accepted and ready to land. LGTM Comment at: test/SemaOpenCL/to_addr_builtin.cl:26 @@ +25,3 @@ +#if __OPENCL_C_VERSION__ < CL_VERSION_2_0 + // expected-error@-2{{'to_global' needs OpenCL version 2.0 o

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-11 Thread Anastasia Stulova via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/to_addr_builtin.cl:26 @@ +25,3 @@ +#if __OPENCL_C_VERSION__ < CL_VERSION_2_0 + // expected-error@-2{{'to_global' needs OpenCL version 2.0 or above}} +#else @Xiuli, I think Sam is right. Passing constant

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-11 Thread Yaxun Liu via cfe-commits
yaxunl updated the summary for this revision. yaxunl updated this revision to Diff 56915. yaxunl marked an inline comment as done. yaxunl added a comment. Removed dynamic generation of builtin decl. Added a test for mismatched returned pointee types. http://reviews.llvm.org/D19932 Files: inc

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-11 Thread Yaxun Liu via cfe-commits
yaxunl marked 8 inline comments as done. Comment at: lib/Sema/SemaChecking.cpp:480 @@ +479,3 @@ + .getQualifiers().getAddressSpace() == LangAS::opencl_constant) { +S.Diag(Call->getLocStart(), diag::err_opencl_builtin_to_addr_invalid_arg) +<< Call->getArg(0) << Cal

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-10 Thread Xiuli PAN via cfe-commits
pxli168 added inline comments. Comment at: test/SemaOpenCL/to_addr_builtin.cl:25 @@ +24,3 @@ + glob = to_global(con); +#if __OPENCL_C_VERSION__ < CL_VERSION_2_0 + // expected-error@-2{{'to_global' needs OpenCL version 2.0 or above}} yaxunl wrote: > pxli168 wrote

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-10 Thread Anastasia Stulova via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaChecking.cpp:480 @@ +479,3 @@ + .getQualifiers().getAddressSpace() == LangAS::opencl_constant) { +S.Diag(Call->getLocStart(), diag::err_opencl_builtin_to_addr_invalid_arg) +<< Call->getArg(0) << Call->getDi

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-10 Thread Yaxun Liu via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. Updated summary. Comment at: test/SemaOpenCL/to_addr_builtin.cl:25 @@ +24,3 @@ + glob = to_global(con); +#if __OPENCL_C_VERSION__ < CL_VERSION_2_0 + // expected-error@-2{{'to_global' needs OpenCL version 2.0 or a

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-10 Thread Xiuli PAN via cfe-commits
pxli168 added a comment. You can update the SUMMARY of this diff as we are now using generic codegen output. And there are some inline comments about spec. Comment at: test/SemaOpenCL/to_addr_builtin.cl:25 @@ +24,3 @@ + glob = to_global(con); +#if __OPENCL_C_VERSION__ < CL_VER

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-09 Thread Yaxun Liu via cfe-commits
yaxunl updated this revision to Diff 56605. yaxunl marked an inline comment as done. yaxunl added a comment. Generate calls to void addr* to_addr(void*) with bitcasts. http://reviews.llvm.org/D19932 Files: include/clang/Basic/Builtins.def include/clang/Basic/DiagnosticSemaKinds.td lib/AST

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-09 Thread Yaxun Liu via cfe-commits
yaxunl marked 4 inline comments as done. Comment at: test/SemaOpenCL/to_addr_builtin.cl:24 @@ +23,3 @@ + + glob = to_global(con); +#if __OPENCL_C_VERSION__ < CL_VERSION_2_0 pxli168 wrote: > should this return a NULL or a build error? the function is declared as

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-08 Thread Xiuli PAN via cfe-commits
pxli168 added a comment. The pointer type seems to be not that important, we can just cast it to any type we want. Comment at: test/SemaOpenCL/to_addr_builtin.cl:24 @@ +23,3 @@ + + glob = to_global(con); +#if __OPENCL_C_VERSION__ < CL_VERSION_2_0 should this r

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-06 Thread Yaxun Liu via cfe-commits
yaxunl marked 5 inline comments as done. yaxunl added a comment. > I agree with Xiuli, if we don't have generic implementation with i8*, the > libraries would have to contain every possible implementation of each AS > conversion builtin including user defined types (which we don't even know >

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-06 Thread Anastasia Stulova via cfe-commits
Anastasia added a comment. In http://reviews.llvm.org/D19932#422374, @yaxunl wrote: > In http://reviews.llvm.org/D19932#421961, @pxli168 wrote: > > > Could we output a generic function in CodeGen? > > This seems to have no big difference to have a lot of declaration in an > > opencl c header fi

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-05 Thread Yaxun Liu via cfe-commits
yaxunl added a comment. In http://reviews.llvm.org/D19932#421961, @pxli168 wrote: > Could we output a generic function in CodeGen? > This seems to have no big difference to have a lot of declaration in an > opencl c header file. What return type and argument type to use would you suggest for

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-04 Thread Xiuli PAN via cfe-commits
pxli168 added a comment. Could we output a generic function in CodeGen? This seems to have no big difference to have a lot of declaration in an opencl c header file. http://reviews.llvm.org/D19932 ___ cfe-commits mailing list cfe-commits@lists.llvm

Re: [PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

2016-05-04 Thread Yaxun Liu via cfe-commits
yaxunl updated this revision to Diff 56194. yaxunl added a comment. Update the test. http://reviews.llvm.org/D19932 Files: include/clang/Basic/Builtins.def include/clang/Basic/DiagnosticSemaKinds.td lib/AST/Decl.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaChecking.cpp lib/Sema/SemaEx