Skip to content

Commit 0a990f8

Browse files
[ESIMD] Let ESIMD attributes not depend on -fsycl-explicit-simd (#3446)
This is one of the final patches to support mixing SYCL and ESIMD kernels. In the end, we want to get rid of `-fsycl-explicit-simd` option and unify the two modes: regular SYCL and ESIMD. This patch eliminates one of the dependencies on the `-fsycl-explicit-simd` flag, allowing to use ESIMD attributes without it.
1 parent ae45333 commit 0a990f8

9 files changed

+8
-12
lines changed

clang/include/clang/Basic/Attr.td

-4
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ def SYCL : LangOpt<"SYCL">;
337337
def SYCLIsDevice : LangOpt<"SYCLIsDevice">;
338338
def SYCLIsHost : LangOpt<"SYCLIsHost">;
339339
def SilentlyIgnoreSYCLIsHost : LangOpt<"SYCLIsHost", "", 1>;
340-
def SYCLExplicitSIMD : LangOpt<"SYCLExplicitSIMD">;
341340
def COnly : LangOpt<"", "!LangOpts.CPlusPlus">;
342341
def CPlusPlus : LangOpt<"CPlusPlus">;
343342
def OpenCL : LangOpt<"OpenCL">;
@@ -1195,7 +1194,6 @@ def SYCLSimd : InheritableAttr {
11951194
let Spellings = [GNU<"sycl_explicit_simd">,
11961195
CXX11<"intel", "sycl_explicit_simd">];
11971196
let Subjects = SubjectList<[Function, GlobalVar]>;
1198-
let LangOpts = [SYCLExplicitSIMD];
11991197
let Documentation = [SYCLSimdDocs];
12001198
let SupportsNonconformingLambdaSyntax = 1;
12011199
}
@@ -1208,7 +1206,6 @@ def SYCLRegisterNum : InheritableAttr {
12081206
let Subjects = SubjectList<[GlobalVar]>;
12091207
// This attribute is applied to file-scope variables and must be compilable
12101208
// for the host device as well
1211-
let LangOpts = [SYCLExplicitSIMD];
12121209
let Documentation = [SYCLRegisterNumDocs];
12131210
}
12141211

@@ -1221,7 +1218,6 @@ def SYCLSimdAccessorPtr : InheritableAttr {
12211218
// No spelling, as this attribute can't be created in the source code.
12221219
let Spellings = [];
12231220
let Subjects = SubjectList<[ParmVar]>;
1224-
let LangOpts = [SYCLExplicitSIMD];
12251221
let Documentation = [Undocumented];
12261222
}
12271223

clang/test/CodeGenSYCL/esimd-accessor-ptr-md.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// separate. So, we can split this test into 2, where one
44
// will be testing code generation and the second ESIMD lowering.
55
//
6-
// RUN: %clang_cc1 -fsycl-explicit-simd -fsycl-is-device \
6+
// RUN: %clang_cc1 -fsycl-is-device \
77
// RUN: -internal-isystem %S/Inputs -triple spir64-unknown-unknown-sycldevice \
88
// RUN: -disable-llvm-passes -emit-llvm %s -o %t
99
// RUN: sycl-post-link -split-esimd -lower-esimd -O0 -S %t -o %t.table

clang/test/CodeGenSYCL/esimd-private-global.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// will be testing code generation and the second ESIMD lowering.
55
//
66
// RUN: %clang_cc1 -disable-llvm-passes -triple spir64-unknown-unknown-sycldevice \
7-
// RUN: -fsycl-is-device -fsycl-explicit-simd -emit-llvm %s -o %t
7+
// RUN: -fsycl-is-device -emit-llvm %s -o %t
88
// RUN: sycl-post-link -split-esimd -lower-esimd -O0 -S %t -o %t.table
99
// RUN: FileCheck %s -input-file=%t_esimd_0.ll
1010

clang/test/CodeGenSYCL/esimd_metadata1.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -disable-llvm-passes -triple spir64-unknown-unknown-sycldevice \
2-
// RUN: -fsycl-is-device -fsycl-explicit-simd -S -emit-llvm %s -o - | \
2+
// RUN: -fsycl-is-device -S -emit-llvm %s -o - | \
33
// RUN: FileCheck %s
44

55
// The test checks that:

clang/test/CodeGenSYCL/esimd_metadata2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -disable-llvm-passes -triple spir64-unknown-unknown-sycldevice -fsycl-is-device -fsycl-explicit-simd -S -emit-llvm %s -o - | FileCheck %s --check-prefixes CHECK,CHECK-ESIMD
1+
// RUN: %clang_cc1 -disable-llvm-passes -triple spir64-unknown-unknown-sycldevice -fsycl-is-device -S -emit-llvm %s -o - | FileCheck %s --check-prefixes CHECK,CHECK-ESIMD
22

33
// This test checks that attribute !intel_reqd_sub_group_size !1
44
// is added for kernels with !sycl_explicit_simd

clang/test/CodeGenSYCL/int_header_esimd.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fsycl-explicit-simd -fsycl-is-device -internal-isystem %S/Inputs -fsycl-int-header=%t.h %s
1+
// RUN: %clang_cc1 -fsycl-is-device -internal-isystem %S/Inputs -fsycl-int-header=%t.h %s
22
// RUN: FileCheck -input-file=%t.h %s
33

44
// This test checks that
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// RUN: %clang_cc1 -fsycl-is-device -fsycl-explicit-simd -fsyntax-only -verify %s
1+
// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify %s
22
// expected-no-diagnostics
33
int x = 0;

clang/test/SemaSYCL/esimd-private-global.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fsycl-is-device -fsycl-explicit-simd -fsyntax-only -verify -pedantic %s
1+
// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify -pedantic %s
22

33
// This test checks specifics of semantic analysis of ESIMD private globals
44

clang/test/SemaSYCL/sycl-esimd.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fsycl-is-device -fsycl-explicit-simd -fsyntax-only -Wno-sycl-2017-compat -verify %s
1+
// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -Wno-sycl-2017-compat -verify %s
22

33
// This test checks specifics of semantic analysis of ESIMD kernels.
44

0 commit comments

Comments
 (0)