@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify -DSYCL %s
+// RUN: %clang_cc1 -fsycl-is-host -fsyntax-only -verify -DHOST %s
tahonermann wrote:
Since SYCL applies to both host and device, let's differentiate by "host" and
"device" (wi
@@ -12909,6 +12909,9 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
if (D->hasAttr())
return false;
+ if (LangOpts.SYCLIsDevice && !D->hasAttr())
+return false;
tahonermann wrote:
This will also need to check for the new `SYCLExternalAttr`
https://github.com/tahonermann edited
https://github.com/llvm/llvm-project/pull/140282
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -62,6 +62,7 @@ class SemaSYCL : public SemaBase {
ParsedType ParsedTy);
void handleKernelAttr(Decl *D, const ParsedAttr &AL);
+ void handleSYCLExternalAttr(Decl *D, const ParsedAttr &AL);
tahonermann wrote:
Since t
@@ -12746,6 +12746,11 @@ def err_sycl_special_type_num_init_method : Error<
"types with 'sycl_special_class' attribute must have one and only one
'__init' "
"method defined">;
+//SYCL external attribute diagnostics
+def err_sycl_attribute_internal_decl
+: Error<"%0 at
@@ -1545,6 +1550,18 @@ def SYCLKernel : InheritableAttr {
let Documentation = [SYCLKernelDocs];
}
+def GlobalStorageNonLocalVar : SubsetSubjecthasGlobalStorage() &&
+ !S->isLocalVarDeclOrParm()}],
+
@@ -408,10 +408,14 @@ class SubjectList subjects, SubjectDiag
diag = WarnDiag,
string CustomDiag = customDiag;
}
-class LangOpt {
+class LangOpt {
// The language option to test; ignored when custom code is supplied.
string Name = name;
+ // If set to 1, the attrib
@@ -12926,6 +12929,10 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
// FIXME: Functions declared with SYCL_EXTERNAL are required during
// device compilation.
tahonermann wrote:
```suggestion
```
https://github.com/llvm/llvm-project/pull/140
@@ -1545,6 +1550,18 @@ def SYCLKernel : InheritableAttr {
let Documentation = [SYCLKernelDocs];
}
+def GlobalStorageNonLocalVar : SubsetSubjecthasGlobalStorage() &&
+ !S->isLocalVarDeclOrParm()}],
+
@@ -0,0 +1,155 @@
+// RUN: %clang_cc1 -verify -fsyntax-only -std=c++20 -Wconversion %s
+
+void c8(char8_t);
+void c16(char16_t);
+void c32(char32_t);
+
+void test(char8_t u8, char16_t u16, char32_t u32) {
+c8(u8);
+c8(u16); // expected-warning {{implicit conversion from 'c
tahonermann wrote:
I ended up spending a lot of time barking down the wrong rabbit hole due to
these changes. @rnk, please see
https://github.com/llvm/llvm-project/issues/140799.
https://github.com/llvm/llvm-project/pull/133545
___
cfe-commits mailin
tahonermann wrote:
I ended up spending a lot of time barking down the wrong rabbit hole due to
these changes. @rnk, please see
https://github.com/llvm/llvm-project/issues/140799.
https://github.com/llvm/llvm-project/pull/134196
___
cfe-commits mailin
@@ -367,6 +370,67 @@ void
SemaSYCL::CheckSYCLEntryPointFunctionDecl(FunctionDecl *FD) {
namespace {
+CompoundStmt *BuildSYCLKernelLaunchStmt(Sema &SemaRef, FunctionDecl *FD,
+const std::string &KernelName) {
+ ASTContext &Ctx = SemaRe
@@ -4084,6 +4084,19 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New,
NamedDecl *&OldD, Scope *S,
diag::note_carries_dependency_missing_first_decl) << 0/*Function*/;
}
+// SYCL 2020 section 5.10.1, "SYCL functions and member functions linkage":
+// W
@@ -12251,6 +12264,9 @@ bool Sema::CheckFunctionDeclaration(Scope *S,
FunctionDecl *NewFD,
if (NewFD->hasAttr())
SYCL().CheckSYCLEntryPointFunctionDecl(NewFD);
+ if (NewFD->hasAttr())
+SYCL().CheckSYCLExternalFunctionDecl(NewFD);
tahonermann wrote:
@@ -12251,6 +12264,9 @@ bool Sema::CheckFunctionDeclaration(Scope *S,
FunctionDecl *NewFD,
if (NewFD->hasAttr())
SYCL().CheckSYCLEntryPointFunctionDecl(NewFD);
+ if (NewFD->hasAttr())
+SYCL().CheckSYCLExternalFunctionDecl(NewFD);
tahonermann wrote:
@@ -0,0 +1,77 @@
+// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown
-disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
+
+// This test code generation when sycl_external attribute is used
+
+// Function defined and not used - symbols emitted
+[[clang::sycl_ex
@@ -12251,6 +12264,9 @@ bool Sema::CheckFunctionDeclaration(Scope *S,
FunctionDecl *NewFD,
if (NewFD->hasAttr())
SYCL().CheckSYCLEntryPointFunctionDecl(NewFD);
+ if (NewFD->hasAttr())
+SYCL().CheckSYCLExternalFunctionDecl(NewFD);
tahonermann wrote:
@@ -4084,6 +4084,19 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New,
NamedDecl *&OldD, Scope *S,
diag::note_carries_dependency_missing_first_decl) << 0/*Function*/;
}
+// SYCL 2020 section 5.10.1, "SYCL functions and member functions linkage":
+// W
@@ -0,0 +1,77 @@
+// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown
-disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
+
+// This test code generation when sycl_external attribute is used
+
+// Function defined and not used - symbols emitted
+[[clang::sycl_ex
@@ -0,0 +1,157 @@
+// RUN: %clang_cc1 -fsycl-is-host -std=c++17 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsycl-is-device -std=c++17 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsycl-is-host -std=c++20 -fsyntax-only -verify -DCPP20 %s
+// RUN: %clang_cc1 -fsycl-is-device -st
https://github.com/tahonermann requested changes to this pull request.
Suggestions to address the diagnostic issues with explicit and implicit
template instantiations as well as a couple of additional tests.
https://github.com/llvm/llvm-project/pull/140282
__
https://github.com/tahonermann edited
https://github.com/llvm/llvm-project/pull/140282
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,78 @@
+// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown
-disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
+
+// This test code generation when sycl_external attribute is used
+
+// Function defined and not used - symbols emitted
+[[clang::sycl_ex
@@ -0,0 +1,157 @@
+// RUN: %clang_cc1 -fsycl-is-host -std=c++17 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsycl-is-device -std=c++17 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsycl-is-host -std=c++20 -fsyntax-only -verify -DCPP20 %s
+// RUN: %clang_cc1 -fsycl-is-device -st
@@ -0,0 +1,78 @@
+// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown
-disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
+
+// This test code generation when sycl_external attribute is used
+
+// Function defined and not used - symbols emitted
+[[clang::sycl_ex
@@ -250,6 +250,20 @@ static bool CheckSYCLKernelName(Sema &S, SourceLocation
Loc,
return false;
}
+void SemaSYCL::CheckSYCLExternalFunctionDecl(FunctionDecl *FD) {
+ const auto *SEAttr = FD->getAttr();
+ assert(SEAttr && "Missing sycl_external attribute");
+ if (!FD->isE
@@ -0,0 +1,157 @@
+// RUN: %clang_cc1 -fsycl-is-host -std=c++17 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsycl-is-device -std=c++17 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsycl-is-host -std=c++20 -fsyntax-only -verify -DCPP20 %s
+// RUN: %clang_cc1 -fsycl-is-device -st
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/152403
>From 5b42f6b9470a96a79b3474fcf384fa950449e095 Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Wed, 6 Aug 2025 19:26:54 -0700
Subject: [PATCH 1/2] [SYCL] SYCL host kernel launch support for the
sycl_kern
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/152403
>From 5b42f6b9470a96a79b3474fcf384fa950449e095 Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Wed, 6 Aug 2025 19:26:54 -0700
Subject: [PATCH 1/4] [SYCL] SYCL host kernel launch support for the
sycl_kern
https://github.com/tahonermann approved this pull request.
Thank you, @schittir, for all your hard work on this! It looks great!
@erichkeane, @bader, please review at your earliest convenience!
https://github.com/llvm/llvm-project/pull/140282
___
cfe-
https://github.com/tahonermann closed
https://github.com/llvm/llvm-project/pull/154583
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/152403
>From 5b42f6b9470a96a79b3474fcf384fa950449e095 Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Wed, 6 Aug 2025 19:26:54 -0700
Subject: [PATCH 1/3] [SYCL] SYCL host kernel launch support for the
sycl_kern
@@ -410,6 +474,36 @@ class OutlinedFunctionDeclBodyInstantiator
ParmDeclMap &MapRef;
};
+OutlinedFunctionDecl *BuildSYCLKernelEntryPointOutline(Sema &SemaRef,
+ FunctionDecl *FD,
+
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/152403
>From d0b53b9550d4332049b3b28ca649e2cf47a0cfbc Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Wed, 6 Aug 2025 19:26:54 -0700
Subject: [PATCH 1/4] [SYCL] SYCL host kernel launch support for the
sycl_kern
https://github.com/tahonermann created
https://github.com/llvm/llvm-project/pull/154591
The only (remaining) use of this forward declaration was removed in
commit 127bf44385424891eb04cff8e52d3f157fc2cb7c.
>From a35c62390074972fe272bc4f0f2a82da5b65 Mon Sep 17 00:00:00 2001
From: Tom Honerman
https://github.com/tahonermann created
https://github.com/llvm/llvm-project/pull/154583
The `sycl_kernel_entry_point` attribute only appertains to functions. This
change adds missing tests to validate that an appropriate diagnostic is issued
for likely unintentional application of the attribut
https://github.com/tahonermann closed
https://github.com/llvm/llvm-project/pull/154591
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
501 - 538 of 538 matches
Mail list logo