[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-28 Thread Alexey Bader via Phabricator via cfe-commits
bader updated this revision to Diff 231386. bader added a comment. Applied code review suggestions. - Split the patch into two parts. This patch contains only Sema part and LLVM IR generation part will be added separately. Updated commit message. - Replace `can't` with `cannot`. Repository:

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. The attribute bits LGTM aside from a wording nit with the diagnostic; I have no opinion on the CodeGen question. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10080 + "template parameter of a

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2477 + if (LangOpts.SYCLIsDevice && Global->hasAttr()) { +// SYCL kernels can be templated and not called from anywhere in the bader wrote: > ABataev wrote: > > bader wrote: >

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-27 Thread Alexey Bader via Phabricator via cfe-commits
bader marked an inline comment as done. bader added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2477 + if (LangOpts.SYCLIsDevice && Global->hasAttr()) { +// SYCL kernels can be templated and not called from anywhere in the ABataev

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2477 + if (LangOpts.SYCLIsDevice && Global->hasAttr()) { +// SYCL kernels can be templated and not called from anywhere in the bader wrote: > ABataev wrote: > > Need to check

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-27 Thread Alexey Bader via Phabricator via cfe-commits
bader marked an inline comment as done. bader added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2477 + if (LangOpts.SYCLIsDevice && Global->hasAttr()) { +// SYCL kernels can be templated and not called from anywhere in the ABataev

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2477 + if (LangOpts.SYCLIsDevice && Global->hasAttr()) { +// SYCL kernels can be templated and not called from anywhere in the Need to check if the decl must be emitted at all.

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-27 Thread Alexey Bader via Phabricator via cfe-commits
bader added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60455/new/ https://reviews.llvm.org/D60455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-20 Thread Alexey Bader via Phabricator via cfe-commits
bader marked 3 inline comments as done. bader added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10079-10080 +def warn_sycl_kernel_invalid_template_param_type : Warning< + "template parameter of template functions with 'sycl_kernel' attribute

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-20 Thread Alexey Bader via Phabricator via cfe-commits
bader updated this revision to Diff 230310. bader added a comment. Applied code review comments from Aaron. Allow template template parameters for function templates marked with `sycl_kernel` attribute. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: arphaman. aaron.ballman added a subscriber: arphaman. aaron.ballman added inline comments. Herald added a subscriber: dexonsmith. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10079-10080 +def

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-20 Thread Alexey Bader via Phabricator via cfe-commits
bader marked an inline comment as done. bader added inline comments. Comment at: clang/test/Misc/pragma-attribute-supported-attributes-list.test:134 // CHECK-NEXT: ReturnsTwice (SubjectMatchRule_function) +// CHECK-NEXT: SYCLKernel (SubjectMatchRule_function) // CHECK-NEXT:

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-20 Thread Alexey Bader via Phabricator via cfe-commits
bader updated this revision to Diff 230281. bader marked 5 inline comments as done. bader added a comment. Applied code review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60455/new/ https://reviews.llvm.org/D60455 Files:

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-20 Thread Alexey Bader via Phabricator via cfe-commits
bader added a subscriber: erichkeane. bader added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10079-10080 +def warn_sycl_kernel_invalid_template_param_type : Warning< + "template parameter of template functions with 'sycl_kernel' attribute

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10076 +def warn_sycl_kernel_num_of_template_params : Warning< + "'sycl_kernel' attribute only applies to template functions with at least" + " two template parameters">, InGroup;

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-19 Thread Alexey Bader via Phabricator via cfe-commits
bader added a comment. @aaron.ballman, @Anastasia, could you take a look at new version of the patch, please? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60455/new/ https://reviews.llvm.org/D60455

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-12 Thread Alexey Bader via Phabricator via cfe-commits
bader marked an inline comment as done. bader added inline comments. Comment at: clang/test/SemaSYCL/device-attributes.cpp:35 +template +[[clang::sycl_kernel]] void foo1(); // expected-warning {{'sycl_kernel' attribute only applies to template funtions with special prototype,

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-12 Thread Alexey Bader via Phabricator via cfe-commits
bader updated this revision to Diff 228868. bader added a subscriber: hfinkel. bader added a comment. Applied two remaining comments from Aaron. - Split diagnostics for `sycl_kernel` attribute to provide more informative message. - Moved attribute target check to TableGen file. I stole a

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-07 Thread Alexey Bader via Phabricator via cfe-commits
bader added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1034 + let Spellings = [Clang<"sycl_kernel">]; + let Subjects = SubjectList<[Function]>; + let LangOpts = [SYCL]; aaron.ballman wrote: > Shouldn't this be `FunctionTemplate` instead?

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-07 Thread Alexey Bader via Phabricator via cfe-commits
bader updated this revision to Diff 228286. bader added a comment. Applied comments from Aaron. Two comments left unresolved: - Split diagnostic message for sycl_kernel attribute into multiple messages. Will do tomorrow. - Change attribute "subject" in TableGen file from "Function" to

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-11-07 Thread Alexey Bader via Phabricator via cfe-commits
bader added a comment. Hi @aaron.ballman, Thanks a lot for the comments and sorry for the long delay. We've been working on complete implementation of the SYCL 1.2.1 specification. Now I have more time to work on contributing the implementation to LLVM project. I re-based the patch and started

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-07-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1034 + let Spellings = [Clang<"sycl_kernel">]; + let Subjects = SubjectList<[Function]>; + let LangOpts = [SYCL]; Shouldn't this be `FunctionTemplate` instead?

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-27 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 206873. Fznamznon added a comment. Minor fix Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60455/new/ https://reviews.llvm.org/D60455 Files: clang/include/clang/Basic/Attr.td

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-27 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 206861. Fznamznon added a comment. Added warning diagnostic for `sycl_kernel` attribute. Now if the `sycl_kernel` attribute applied to a function which doesn't meet requirements for OpenCL kernel generation, attribute will be ignored and diagnostic will

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-24 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/SemaSYCL/device-attributes.cpp:3 + +[[clang::sycl_kernel]] int gv2 = 0; // expected-warning {{'sycl_kernel' attribute only applies to functions}} +__attribute((sycl_kernel)) int gv3 = 0; // expected-warning

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-20 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 205831. Fznamznon added a comment. Fixed a couple coding style issues, renamed markDevice function with markSYCLDevice. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60455/new/

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-20 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 205813. Fznamznon added a comment. Updated `sycl_kernel` attribute documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60455/new/ https://reviews.llvm.org/D60455 Files:

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-19 Thread Ronan Keryell via Phabricator via cfe-commits
keryell added inline comments. Comment at: clang/test/SemaSYCL/device-attributes.cpp:3 + +[[clang::sycl_kernel]] int gv2 = 0; // expected-warning {{'sycl_kernel' attribute only applies to functions}} +__attribute((sycl_kernel)) int gv3 = 0; // expected-warning {{'sycl_kernel'

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-19 Thread Alexey Bader via Phabricator via cfe-commits
bader added inline comments. Comment at: clang/test/SemaSYCL/device-attributes.cpp:3 + +[[clang::sycl_kernel]] int gv2 = 0; // expected-warning {{'sycl_kernel' attribute only applies to functions}} +__attribute((sycl_kernel)) int gv3 = 0; // expected-warning {{'sycl_kernel'

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-19 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:263-264 +entry point to device code i.e. will be called by host in run time. +Here is a code example of the SYCL program, which demonstrates the need for +this attribute: +.. code-block:: c++

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-19 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 205663. Fznamznon added a comment. Appled part of comments from @aaron.ballman: - Fixed grammar and code style in all places except sycl_kernel docs - Added a lit test which checks that sycl_device attribute implicitly added to proper declarations

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/SemaSYCL/device-attributes.cpp:3 + +[[clang::sycl_kernel]] int gv2 = 0; // expected-warning {{'sycl_kernel' attribute only applies to functions}} +__attribute((sycl_kernel)) int gv3 = 0; // expected-warning

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-18 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/test/SemaSYCL/device-attributes.cpp:3 + +[[clang::sycl_kernel]] int gv2 = 0; // expected-warning {{'sycl_kernel' attribute only applies to functions}} +__attribute((sycl_kernel)) int gv3 = 0; // expected-warning {{'sycl_kernel'

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Most of the comments are about minor nits like grammar and coding conventions, but I did have some questions regarding what kinds of functions the sycl_kernel attribute gets applied to. Also, I'd like to see some additional tests that demonstrate the sycl device

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-18 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60455/new/ https://reviews.llvm.org/D60455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-11 Thread Aaron Ballman via cfe-commits
tel.com>; Gainullin, Artur ; > b00234...@studentmail.uws.ac.uk; bevin.hans...@ericsson.com; > cfe-commits@lists.llvm.org; mlek...@skidmore.edu; blitzrak...@gmail.com; > shen...@google.com > *Subject:* Re: [PATCH] D60455: [SYCL] Implement SYCL device code outlining > > > > I'm

RE: [PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-11 Thread Bader, Alexey via cfe-commits
@lists.llvm.org; mlek...@skidmore.edu; blitzrak...@gmail.com; shen...@google.com Subject: Re: [PATCH] D60455: [SYCL] Implement SYCL device code outlining I'm out of the office until next week and won't be able to review it until then. If another trusted reviewer accepts, I can always do post commit

Re: [PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-11 Thread Aaron Ballman via cfe-commits
I'm out of the office until next week and won't be able to review it until then. If another trusted reviewer accepts, I can always do post commit review. ~Aaron On Tue, Jun 11, 2019, 2:43 PM Mariya Podchishchaeva via Phabricator < revi...@reviews.llvm.org> wrote: > Fznamznon added a comment. >

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-11 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. @aaron.ballman , please let me know if you have additional comments/suggestions. If not, could you please accept this revision? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60455/new/ https://reviews.llvm.org/D60455

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-10 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 203785. Fznamznon added a comment. Applied comments from @Anastasia - Added link to documentation for `sycl_device` attribute - Removed redundant comment from test @Anastasia, do you have additional comments? Repository: rG LLVM Github Monorepo

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-03 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/test/CodeGenSYCL/device-functions.cpp:24 +} +// CHECK: define spir_func void @{{.*}}foo +// CHECK: define linkonce_odr spir_func i32 @{{.*}}bar Fznamznon wrote: > Anastasia wrote: > > Fznamznon wrote: > > >

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-03 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/test/CodeGenSYCL/device-functions.cpp:24 +} +// CHECK: define spir_func void @{{.*}}foo +// CHECK: define linkonce_odr spir_func i32 @{{.*}}bar Anastasia wrote: > Fznamznon wrote: > > Anastasia wrote: > > > I

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-06-03 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/test/CodeGenSYCL/device-functions.cpp:24 +} +// CHECK: define spir_func void @{{.*}}foo +// CHECK: define linkonce_odr spir_func i32 @{{.*}}bar Fznamznon wrote: > Anastasia wrote: > > I can't see where the SPIR

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-31 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1017 + let LangOpts = [SYCL]; + let Documentation = [Undocumented]; +} Anastasia wrote: > Undocumented -> SYCLKernelDocs Oh, Thank you for that! Comment at:

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-30 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1017 + let LangOpts = [SYCL]; + let Documentation = [Undocumented]; +} Undocumented -> SYCLKernelDocs Comment at: clang/include/clang/Basic/AttrDocs.td:269 + +

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-28 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 201641. Fznamznon added a comment. Applied comments from @Anastasia - Added documentation for sycl_kernel function - Added comments to Sema.h - Added -std=c++11 to test run lines Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-28 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/test/SemaSYCL/device-attributes-on-non-sycl.cpp:1 +// RUN: %clang_cc1 -fsyntax-only -fsycl-is-device -verify %s +// Now pretend that we're compiling regular C++ file without SYCL mode enabled. Anastasia wrote: >

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D60455#1518178 , @bader wrote: > In D60455#1513499 , @Anastasia wrote: > > > //**Design question**//: since you are not aware what functions are to be > > run on a device while

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-27 Thread Alexey Bader via Phabricator via cfe-commits
bader added a comment. In D60455#1513499 , @Anastasia wrote: > //**Design question**//: since you are not aware what functions are to be run > on a device while parsing them, at what point do you plan to diagnose the > invalid behavior from the standard

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. //**Design question**//: since you are not aware what functions are to be run on a device while parsing them, at what point do you plan to diagnose the invalid behavior from the standard C++ i.e. using function pointers in kernel code is likely to cause issues? Also

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-23 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1017 + let LangOpts = [SYCL]; + let Documentation = [Undocumented]; +} bader wrote: > Anastasia wrote: > > Ok, I thought the earlier request was not to add undocumented attributes

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-22 Thread Alexey Bader via Phabricator via cfe-commits
bader added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1017 + let LangOpts = [SYCL]; + let Documentation = [Undocumented]; +} Anastasia wrote: > Ok, I thought the earlier request was not to add undocumented attributes with > the spelling?

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-22 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1017 + let LangOpts = [SYCL]; + let Documentation = [Undocumented]; +} Ok, I thought the earlier request was not to add undocumented attributes with the spelling? Also did

[PATCH] D60455: [SYCL] Implement SYCL device code outlining

2019-05-22 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 200658. Fznamznon added a comment. Minor fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60455/new/ https://reviews.llvm.org/D60455 Files: clang/include/clang/Basic/Attr.td