[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-22 Thread Alexey Bader via cfe-commits
https://github.com/bader edited https://github.com/llvm/llvm-project/pull/122379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-22 Thread Alexey Bader via cfe-commits
https://github.com/bader approved this pull request. @tahonermann thanks a lot for the work. I really appreciate the detailed description and comments! @erichkeane did a great job with the code review, so I have nothing to add. I just have one small question that does not affect the merge. ht

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-22 Thread Alexey Bader via cfe-commits
@@ -362,3 +364,93 @@ void SemaSYCL::CheckSYCLEntryPointFunctionDecl(FunctionDecl *FD) { } } } + +namespace { + +// The body of a function declared with the [[sycl_kernel_entry_point]] +// attribute is cloned and transformed to substitute references to the original +// fu

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-22 Thread Tom Honermann via cfe-commits
tahonermann wrote: > No idea why I can't respond to the individual threads but... @erichkeane, in order to reduce notifications, I replied to your comments as a review. You should generally be able to reply to them individually or as part of a batched review from the "Files changed" tab, but G

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-22 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/122379 >From a6342615862c8ec48459ec95334d812bcb6a6e55 Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Wed, 8 May 2024 14:31:36 -0700 Subject: [PATCH 1/6] [SYCL] AST support for SYCL kernel entry point functions.

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-22 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. make format happy, then LGTM. https://github.com/llvm/llvm-project/pull/122379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-22 Thread Erich Keane via cfe-commits
erichkeane wrote: No idea why I can't respond to the individual threads but... >The coding standards don't specify to add a comment there and a brief survey >of other headers in this directory indicates considerable inconsistency (72 >out of 123 .h files have them). I guess that is over 50% so

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Tom Honermann via cfe-commits
@@ -18,6 +18,7 @@ #include "clang/AST/StmtObjC.h" #include "clang/AST/StmtOpenACC.h" #include "clang/AST/StmtOpenMP.h" +#include "clang/AST/StmtSYCL.h" tahonermann wrote: Hmm, looks like no reason at all. I'm guessing it was once needed for some X-Macro usage

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann edited https://github.com/llvm/llvm-project/pull/122379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Tom Honermann via cfe-commits
@@ -480,6 +480,7 @@ following requirements. * Is not a C variadic function. * Is not a coroutine. * Is not defined as deleted or as defaulted. +* Is not defined with a function try block. tahonermann wrote: The SYCL specification isn't relevant here as `sycl_k

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,94 @@ +//===- StmtSYCL.h - Classes for SYCL kernel calls ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann commented: > I only saw 1 unresolved, not 2? But I resolved it. Can you point out the > other? The other one was [this one](https://github.com/llvm/llvm-project/pull/122379#discussion_r1910706213); You gave it a thumbs up, so I went ahead and resolved it now.

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 3 comments are all 'nits', so once those conversations are resolved, this LGTM. Please resolve those 3 before merging. https://github.com/llvm/llvm-project/pull/122379 ___ cfe-commits mailing

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I only saw 1 unresolved, not 2? But I resolved it. Can you point out the other? https://github.com/llvm/llvm-project/pull/122379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Erich Keane via cfe-commits
@@ -0,0 +1,94 @@ +//===- StmtSYCL.h - Classes for SYCL kernel calls ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Erich Keane via cfe-commits
@@ -18,6 +18,7 @@ #include "clang/AST/StmtObjC.h" #include "clang/AST/StmtOpenACC.h" #include "clang/AST/StmtOpenMP.h" +#include "clang/AST/StmtSYCL.h" erichkeane wrote: Why is this here? https://github.com/llvm/llvm-project/pull/122379

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Erich Keane via cfe-commits
@@ -480,6 +480,7 @@ following requirements. * Is not a C variadic function. * Is not a coroutine. * Is not defined as deleted or as defaulted. +* Is not defined with a function try block. erichkeane wrote: Did we submit an issue against the SYCL spec here? Se

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/122379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-21 Thread Erich Keane via cfe-commits
@@ -0,0 +1,92 @@ +//===- StmtSYCL.h - Classes for SYCL kernel calls ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
tahonermann wrote: @erichkeane, thank you for the prior code review. I believe I've addressed all the concerns you raised. There are two conversations I left unresolved pending any further response from you. https://github.com/llvm/llvm-project/pull/122379 _

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann edited https://github.com/llvm/llvm-project/pull/122379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,92 @@ +//===- StmtSYCL.h - Classes for SYCL kernel calls ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -1376,6 +1377,16 @@ void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) { Code = serialization::DECL_BLOCK; } +void ASTDeclWriter::VisitOutlinedFunctionDecl(OutlinedFunctionDecl *D) { + Record.push_back(D->getNumParams()); + VisitDecl(D); + Record.push_back(D->isNothrow()

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/122379 >From d021c2ba6a5b3f501b2f87317cb9072781069d73 Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Wed, 8 May 2024 14:31:36 -0700 Subject: [PATCH 1/4] [SYCL] AST support for SYCL kernel entry point functions.

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -451,9 +452,9 @@ class ASTDeclReader : public DeclVisitor { void VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D); void VisitOMPRequiresDecl(OMPRequiresDecl *D); void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D); - }; tahonermann wrote: Committ

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,92 @@ +//===- StmtSYCL.h - Classes for SYCL kernel calls ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-18 Thread Tom Honermann via cfe-commits
@@ -451,9 +452,9 @@ class ASTDeclReader : public DeclVisitor { void VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D); void VisitOMPRequiresDecl(OMPRequiresDecl *D); void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D); - }; +}; - } // namespace clang --

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -0,0 +1,92 @@ +//===- StmtSYCL.h - Classes for SYCL kernel calls ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -1793,6 +1794,16 @@ void ASTDeclReader::VisitBlockDecl(BlockDecl *BD) { BD->setCaptures(Reader.getContext(), captures, capturesCXXThis); } +void ASTDeclReader::VisitOutlinedFunctionDecl(OutlinedFunctionDecl *D) { + // NumParams is deserialized by OutlinedFunctionDecl::Cr

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -451,9 +452,9 @@ class ASTDeclReader : public DeclVisitor { void VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D); void VisitOMPRequiresDecl(OMPRequiresDecl *D); void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D); - }; erichkeane wrote: Unrelate

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -451,9 +452,9 @@ class ASTDeclReader : public DeclVisitor { void VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D); void VisitOMPRequiresDecl(OMPRequiresDecl *D); void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D); - }; +}; - } // namespace clang --

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -0,0 +1,92 @@ +//===- StmtSYCL.h - Classes for SYCL kernel calls ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -1376,6 +1377,16 @@ void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) { Code = serialization::DECL_BLOCK; } +void ASTDeclWriter::VisitOutlinedFunctionDecl(OutlinedFunctionDecl *D) { + Record.push_back(D->getNumParams()); + VisitDecl(D); + Record.push_back(D->isNothrow()

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-10 Thread Erich Keane via cfe-commits
@@ -4678,6 +4678,95 @@ class BlockDecl : public Decl, public DeclContext { } }; +/// Represents a partial function definition. +/// +/// An outlined function declaration contains the parameters and body of +/// a function independent of other function definition concerns suc

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-09 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/122379 >From d021c2ba6a5b3f501b2f87317cb9072781069d73 Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Wed, 8 May 2024 14:31:36 -0700 Subject: [PATCH 1/2] [SYCL] AST support for SYCL kernel entry point functions.

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-09 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/122379 >From d021c2ba6a5b3f501b2f87317cb9072781069d73 Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Wed, 8 May 2024 14:31:36 -0700 Subject: [PATCH 1/2] [SYCL] AST support for SYCL kernel entry point functions.

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-09 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 03eb786f75e36e9e203e0092ec3c6c589fd53c4f d021c2ba6a5b3f501b2f87317cb9072781069d73 --e

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules @llvm/pr-subscribers-clang Author: Tom Honermann (tahonermann) Changes A SYCL kernel entry point function is a non-member function or a static member function declared with the `sycl_kernel_entry_point` attribute. Such functions define a

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Tom Honermann (tahonermann) Changes A SYCL kernel entry point function is a non-member function or a static member function declared with the `sycl_kernel_entry_point` attribute. Such functions define a pattern for an offload kern

[clang] [SYCL] AST support for SYCL kernel entry point functions. (PR #122379)

2025-01-09 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann created https://github.com/llvm/llvm-project/pull/122379 A SYCL kernel entry point function is a non-member function or a static member function declared with the `sycl_kernel_entry_point` attribute. Such functions define a pattern for an offload kernel entry poi