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 *

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

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

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?

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
ok.com; anastasia.stul...@arm.com Cc: jan.ves...@rutgers.edu; Stellard, Thomas <tom.stell...@amd.com>; 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.

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=57972#toc Repository: rL LLVM

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2016-05-04 Thread Yaxun Liu via cfe-commits
yaxunl created this revision. yaxunl added reviewers: Anastasia, pxli168. yaxunl added subscribers: cfe-commits, tstellarAMD. OpenCL builtin functions to_{global|local|private} accepts argument of pointer type to arbitrary pointee type, and return a pointer to the same pointee type in different