Skip to content

Commit 70ce765

Browse files
authored
[Driver][NFC] Cleanup some option setting for SYCL offload (#3542)
The area in which we setup options for the device and host compilations is a bit disorganized. Clean up some of this to be a little easier to find where additional options should go. Also clean up the convoluted usage of UseSYCLTriple which was used largely in part when doing the old method of static device lib compilations.
1 parent a194509 commit 70ce765

File tree

7 files changed

+73
-101
lines changed

7 files changed

+73
-101
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

+60-87
Original file line numberDiff line numberDiff line change
@@ -4267,15 +4267,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
42674267
(IsSYCL || IsCuda || IsHIP) ? TC.getAuxTriple() : nullptr;
42684268
bool IsWindowsMSVC = RawTriple.isWindowsMSVCEnvironment();
42694269
bool IsIAMCU = RawTriple.isOSIAMCU();
4270-
bool IsSYCLDevice = (RawTriple.getEnvironment() == llvm::Triple::SYCLDevice ||
4271-
Triple.getEnvironment() == llvm::Triple::SYCLDevice);
4272-
// Using just the sycldevice environment is not enough to determine usage
4273-
// of the device triple when considering fat static archives. The
4274-
// compilation path requires the host object to be fed into the partial link
4275-
// step, and being part of the SYCL tool chain causes the incorrect target.
4276-
// FIXME - Is it possible to retain host environment when on a target
4277-
// device toolchain.
4278-
bool UseSYCLTriple = IsSYCLDevice && (!IsSYCL || IsSYCLOffloadDevice);
42794270

42804271
// Adjust IsWindowsXYZ for CUDA/HIP/SYCL compilations. Even when compiling in
42814272
// device mode (i.e., getToolchain().getTriple() is NVPTX/AMDGCN, not
@@ -4294,16 +4285,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
42944285

42954286
// Add the "effective" target triple.
42964287
CmdArgs.push_back("-triple");
4297-
if (!UseSYCLTriple && IsSYCLDevice) {
4298-
// Do not use device triple when we know the device is not SYCL
4299-
// FIXME: We override the toolchain triple in this instance to address a
4300-
// disconnect with fat static archives. We should have a cleaner way of
4301-
// using the Host environment when on a device toolchain.
4302-
std::string NormalizedTriple =
4303-
llvm::Triple(llvm::sys::getProcessTriple()).normalize();
4304-
CmdArgs.push_back(Args.MakeArgString(NormalizedTriple));
4305-
} else
4306-
CmdArgs.push_back(Args.MakeArgString(TripleStr));
4288+
CmdArgs.push_back(Args.MakeArgString(TripleStr));
43074289

43084290
if (const Arg *MJ = Args.getLastArg(options::OPT_MJ)) {
43094291
DumpCompilationDatabase(C, MJ->getValue(), TripleStr, Output, Input, Args);
@@ -4349,7 +4331,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
43494331

43504332
Arg *SYCLStdArg = Args.getLastArg(options::OPT_sycl_std_EQ);
43514333

4352-
if (UseSYCLTriple) {
4334+
if (IsSYCLOffloadDevice) {
4335+
// Pass the triple of host when doing SYCL
4336+
llvm::Triple AuxT = C.getDefaultToolChain().getTriple();
4337+
std::string NormalizedTriple = AuxT.normalize();
4338+
CmdArgs.push_back("-aux-triple");
4339+
CmdArgs.push_back(Args.MakeArgString(NormalizedTriple));
4340+
43534341
// We want to compile sycl kernels.
43544342
CmdArgs.push_back("-fsycl-is-device");
43554343
CmdArgs.push_back("-fdeclare-spirv-builtins");
@@ -4364,18 +4352,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
43644352
CmdArgs.push_back("-mllvm");
43654353
CmdArgs.push_back("-sycl-opt");
43664354
}
4355+
43674356
// Turn on Dead Parameter Elimination Optimization with early optimizations
43684357
if (!RawTriple.isNVPTX() &&
43694358
Args.hasFlag(options::OPT_fsycl_dead_args_optimization,
43704359
options::OPT_fno_sycl_dead_args_optimization, false))
43714360
CmdArgs.push_back("-fenable-sycl-dae");
4372-
4373-
// Pass the triple of host when doing SYCL
4374-
llvm::Triple AuxT = C.getDefaultToolChain().getTriple();
4375-
std::string NormalizedTriple = AuxT.normalize();
4376-
CmdArgs.push_back("-aux-triple");
4377-
CmdArgs.push_back(Args.MakeArgString(NormalizedTriple));
4378-
43794361
bool IsMSVC = AuxT.isWindowsMSVCEnvironment();
43804362
if (IsMSVC) {
43814363
CmdArgs.push_back("-fms-extensions");
@@ -4404,22 +4386,67 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
44044386
// along with marking the same function with explicit SYCL_EXTERNAL
44054387
CmdArgs.push_back("-Wno-sycl-strict");
44064388
}
4389+
4390+
// Add the integration header option to generate the header.
4391+
StringRef Header(D.getIntegrationHeader(Input.getBaseInput()));
4392+
if (!Header.empty()) {
4393+
SmallString<128> HeaderOpt("-fsycl-int-header=");
4394+
HeaderOpt.append(Header);
4395+
CmdArgs.push_back(Args.MakeArgString(HeaderOpt));
4396+
}
44074397
}
4408-
if (IsSYCL || UseSYCLTriple) {
4398+
4399+
if (IsSYCL) {
44094400
// Set options for both host and device
44104401
if (Arg *A = Args.getLastArg(options::OPT_fsycl_id_queries_fit_in_int,
44114402
options::OPT_fno_sycl_id_queries_fit_in_int))
44124403
A->render(Args, CmdArgs);
4413-
}
44144404

4415-
if (IsSYCL) {
44164405
if (SYCLStdArg) {
44174406
SYCLStdArg->render(Args, CmdArgs);
44184407
CmdArgs.push_back("-fsycl-std-layout-kernel-params");
44194408
} else {
44204409
// Ensure the default version in SYCL mode is 2020
44214410
CmdArgs.push_back("-sycl-std=2020");
44224411
}
4412+
if (Args.hasArg(options::OPT_fsycl_unnamed_lambda))
4413+
CmdArgs.push_back("-fsycl-unnamed-lambda");
4414+
4415+
// Enable generation of USM address spaces for FPGA.
4416+
// __ENABLE_USM_ADDR_SPACE__ will be used during compilation of SYCL headers
4417+
if (getToolChain().getTriple().getSubArch() ==
4418+
llvm::Triple::SPIRSubArch_fpga)
4419+
CmdArgs.push_back("-D__ENABLE_USM_ADDR_SPACE__");
4420+
4421+
// Add any options that are needed specific to SYCL offload while
4422+
// performing the host side compilation.
4423+
if (!IsSYCLOffloadDevice) {
4424+
// Add the -include option to add the integration header
4425+
StringRef Header = D.getIntegrationHeader(Input.getBaseInput());
4426+
if (types::getPreprocessedType(Input.getType()) != types::TY_INVALID &&
4427+
!Header.empty()) {
4428+
CmdArgs.push_back("-include");
4429+
CmdArgs.push_back(Args.MakeArgString(Header));
4430+
// When creating dependency information, filter out the generated
4431+
// header file.
4432+
CmdArgs.push_back("-dependency-filter");
4433+
CmdArgs.push_back(Args.MakeArgString(Header));
4434+
}
4435+
// Let the FE know we are doing a SYCL offload compilation, but we are
4436+
// doing the host pass.
4437+
CmdArgs.push_back("-fsycl-is-host");
4438+
4439+
if (!D.IsCLMode()) {
4440+
// SYCL library is guaranteed to work correctly only with dynamic
4441+
// MSVC runtime.
4442+
llvm::Triple AuxT = C.getDefaultToolChain().getTriple();
4443+
if (AuxT.isWindowsMSVCEnvironment()) {
4444+
CmdArgs.push_back("-D_MT");
4445+
CmdArgs.push_back("-D_DLL");
4446+
CmdArgs.push_back("--dependent-lib=msvcrt");
4447+
}
4448+
}
4449+
}
44234450
}
44244451

44254452
if (IsOpenMPDevice) {
@@ -4500,7 +4527,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
45004527
CmdArgs.push_back("-P");
45014528
}
45024529
} else if (isa<AssembleJobAction>(JA)) {
4503-
if (IsSYCLOffloadDevice && IsSYCLDevice) {
4530+
if (IsSYCLOffloadDevice) {
45044531
CmdArgs.push_back("-emit-llvm-bc");
45054532
} else {
45064533
CmdArgs.push_back("-emit-obj");
@@ -5958,10 +5985,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
59585985
// Forward -cl options to -cc1
59595986
RenderOpenCLOptions(Args, CmdArgs, InputType);
59605987

5961-
// Forward -sycl-std option to -cc1 only if -fsycl is enabled.
5962-
if (Args.hasFlag(options::OPT_fsycl, options::OPT_fno_sycl, false))
5963-
Args.AddLastArg(CmdArgs, options::OPT_sycl_std_EQ);
5964-
59655988
// Forward -fsycl-instrument-device-code option to cc1. This option can only
59665989
// be used with spir triple.
59675990
if (Arg *A = Args.getLastArg(options::OPT_fsycl_instrument_device_code)) {
@@ -6425,7 +6448,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
64256448
// selected. For optimization levels that want vectorization we use the alias
64266449
// option to simplify the hasFlag logic.
64276450
bool EnableVec = shouldEnableVectorizerAtOLevel(Args, false);
6428-
if (UseSYCLTriple && RawTriple.isSPIR() && EnableSYCLEarlyOptimizations)
6451+
if (RawTriple.isSPIR() && EnableSYCLEarlyOptimizations)
64296452
EnableVec = false; // But disable vectorization for SYCL device code
64306453
OptSpecifier VectorizeAliasOption =
64316454
EnableVec ? options::OPT_O_Group : options::OPT_fvectorize;
@@ -6435,7 +6458,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
64356458

64366459
// -fslp-vectorize is enabled based on the optimization level selected.
64376460
bool EnableSLPVec = shouldEnableVectorizerAtOLevel(Args, true);
6438-
if (UseSYCLTriple && RawTriple.isSPIR() && EnableSYCLEarlyOptimizations)
6461+
if (RawTriple.isSPIR() && EnableSYCLEarlyOptimizations)
64396462
EnableSLPVec = false; // But disable vectorization for SYCL device code
64406463
OptSpecifier SLPVectAliasOption =
64416464
EnableSLPVec ? options::OPT_O_Group : options::OPT_fslp_vectorize;
@@ -6640,56 +6663,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
66406663
CmdArgs.push_back("-fcuda-short-ptr");
66416664
}
66426665

6643-
if (IsSYCL) {
6644-
// Add any options that are needed specific to SYCL offload while
6645-
// performing the host side compilation.
6646-
if (!IsSYCLOffloadDevice) {
6647-
// Add the integration header option to generate the header.
6648-
StringRef Header = D.getIntegrationHeader(Input.getBaseInput());
6649-
if (types::getPreprocessedType(InputType) != types::TY_INVALID &&
6650-
!Header.empty()) {
6651-
CmdArgs.push_back("-include");
6652-
CmdArgs.push_back(Args.MakeArgString(Header));
6653-
// When creating dependency information, filter out the generated
6654-
// header file.
6655-
CmdArgs.push_back("-dependency-filter");
6656-
CmdArgs.push_back(Args.MakeArgString(Header));
6657-
}
6658-
// Let the FE know we are doing a SYCL offload compilation, but we are
6659-
// doing the host pass.
6660-
CmdArgs.push_back("-fsycl-is-host");
6661-
6662-
if (!D.IsCLMode()) {
6663-
// SYCL library is guaranteed to work correctly only with dynamic
6664-
// MSVC runtime.
6665-
llvm::Triple AuxT = C.getDefaultToolChain().getTriple();
6666-
if (AuxT.isWindowsMSVCEnvironment()) {
6667-
CmdArgs.push_back("-D_MT");
6668-
CmdArgs.push_back("-D_DLL");
6669-
CmdArgs.push_back("--dependent-lib=msvcrt");
6670-
}
6671-
}
6672-
}
6673-
if (IsSYCLOffloadDevice) {
6674-
// Add the integration header option to generate the header.
6675-
StringRef Header(D.getIntegrationHeader(Input.getBaseInput()));
6676-
if (!Header.empty()) {
6677-
SmallString<128> HeaderOpt("-fsycl-int-header=");
6678-
HeaderOpt.append(Header);
6679-
CmdArgs.push_back(Args.MakeArgString(HeaderOpt));
6680-
}
6681-
}
6682-
6683-
if (Args.hasArg(options::OPT_fsycl_unnamed_lambda))
6684-
CmdArgs.push_back("-fsycl-unnamed-lambda");
6685-
6686-
// Enable generation of USM address spaces for FPGA.
6687-
// __ENABLE_USM_ADDR_SPACE__ will be used during compilation of SYCL headers
6688-
if (getToolChain().getTriple().getSubArch() ==
6689-
llvm::Triple::SPIRSubArch_fpga)
6690-
CmdArgs.push_back("-D__ENABLE_USM_ADDR_SPACE__");
6691-
}
6692-
66936666
if (IsCuda || IsHIP) {
66946667
// Determine the original source input.
66956668
const Action *SourceAction = &JA;

clang/test/Driver/sycl-MD-default.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: %clangxx -### -fsycl -c -target x86_64-unknown-windows-msvc %s 2>&1 \
66
// RUN: | FileCheck -check-prefix=CHK-DEFAULT %s
77
// CHK-DEFAULT-NOT: "-fsycl-is-device" {{.*}} "-D_MT" "-D_DLL"
8-
// CHK-DEFAULT: "-fsycl-is-host" "-D_MT" "-D_DLL" "--dependent-lib=msvcrt{{d*}}" {{.*}}
8+
// CHK-DEFAULT: "-fsycl-is-host"{{.*}} "-D_MT" "-D_DLL" "--dependent-lib=msvcrt{{d*}}" {{.*}}
99

1010
// RUN: %clang_cl -### -fsycl -c %s 2>&1 \
1111
// RUN: | FileCheck -check-prefix=CHK-DEFAULT-CL %s
@@ -14,7 +14,7 @@
1414
// RUN: %clang_cl -### -MDd -fsycl -c %s 2>&1 \
1515
// RUN: | FileCheck -check-prefix=CHK-DEFAULT-CL %s
1616
// CHK-DEFAULT-CL-NOT: "-fsycl-is-device" {{.*}} "-D_MT" "-D_DLL"
17-
// CHK-DEFAULT-CL: "-D_MT" "-D_DLL" "--dependent-lib=msvcrt{{d*}}" {{.*}} "-fsycl-is-host"
17+
// CHK-DEFAULT-CL: "-fsycl-is-host"{{.*}} "-D_MT" "-D_DLL" "--dependent-lib=msvcrt{{d*}}"
1818

1919
// RUN: %clang_cl -### -MT -fsycl -c %s 2>&1 \
2020
// RUN: | FileCheck -check-prefix=CHK-ERROR %s

clang/test/Driver/sycl-offload-intelfpga.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,16 @@
266266
// CHK-FPGA-DEP-FILES: clang{{.*}} "-dependency-file" "[[INPUT1:.+\.d]]" "-MT" "{{.*}}.o"
267267
// CHK-FPGA-DEP-FILES: clang{{.*}} "-dependency-file" "[[INPUT2:.+\.d]]" "-MT" "{{.*}}.o"
268268
// CHK-FPGA-DEP-FILES: aoc{{.*}} "-dep-files={{.*}}[[INPUT1]],{{.*}}[[INPUT2]]"
269-
// CHK-FPGA-DEP-FILES-NOT: clang{{.*}} "-dependency-file" {{.*}} "-fsycl-is-host"
269+
// CHK-FPGA-DEP-FILES-NOT: clang{{.*}} "-fsycl-is-host"{{.*}} "-dependency-file"
270270

271271
/// -fintelfpga dependency file check with host .d enabled
272272
// RUN: %clangxx -### -MMD -fsycl -fintelfpga %t-1.cpp %t-2.cpp 2>&1 \
273273
// RUN: | FileCheck -check-prefix=CHK-FPGA-DEP-FILES-HOST %s
274274
// CHK-FPGA-DEP-FILES-HOST: clang{{.*}} "-dependency-file" "[[INPUT1:.+\.d]]" "-MT" "{{.*}}.o"
275275
// CHK-FPGA-DEP-FILES-HOST: clang{{.*}} "-dependency-file" "[[INPUT2:.+\.d]]" "-MT" "{{.*}}.o"
276276
// CHK-FPGA-DEP-FILES-HOST: aoc{{.*}} "-dep-files={{.*}}[[INPUT1]],{{.*}}[[INPUT2]]"
277-
// CHK-FPGA-DEP-FILES-HOST: clang{{.*}} "-dependency-file" {{.*}} "-fsycl-is-host"
278-
// CHK-FPGA-DEP-FILES-HOST: clang{{.*}} "-dependency-file" {{.*}} "-fsycl-is-host"
277+
// CHK-FPGA-DEP-FILES-HOST: clang{{.*}} "-fsycl-is-host"{{.*}} "-dependency-file"
278+
// CHK-FPGA-DEP-FILES-HOST: clang{{.*}} "-fsycl-is-host"{{.*}} "-dependency-file"
279279

280280
/// -fintelfpga dependency file generation test to object
281281
// RUN: %clangxx -### -fsycl -fintelfpga -target x86_64-unknown-linux-gnu %t-1.cpp %t-2.cpp -c 2>&1 \

clang/test/Driver/sycl-offload-nvptx.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// RUN: -fsycl-targets=nvptx64-nvidia-nvcl-sycldevice --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
99
// RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/libspirv.bc %s 2>&1 \
1010
// RUN: | FileCheck -check-prefix=CHK-ACTIONS %s
11-
// CHK-ACTIONS: "-cc1" "-triple" "nvptx64-nvidia-nvcl-sycldevice"{{.*}} "-fsycl-is-device"{{.*}} "-aux-triple" "x86_64-unknown-linux-gnu"{{.*}} "-Wno-sycl-strict" "-sycl-std=2020" {{.*}} "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl"{{.*}} "-mlink-builtin-bitcode" "{{.*}}libspirv.bc"{{.*}} "-mlink-builtin-bitcode" "{{.*}}libdevice{{.*}}.10.bc"{{.*}} "-target-feature" "+ptx42"{{.*}} "-target-sdk-version=[[CUDA_VERSION:[0-9.]+]]"{{.*}} "-target-cpu" "sm_50"{{.*}} "-std=c++11"{{.*}}
11+
// CHK-ACTIONS: "-cc1" "-triple" "nvptx64-nvidia-nvcl-sycldevice" "-aux-triple" "x86_64-unknown-linux-gnu"{{.*}} "-fsycl-is-device"{{.*}} "-Wno-sycl-strict"{{.*}} "-sycl-std=2020" {{.*}} "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl"{{.*}} "-mlink-builtin-bitcode" "{{.*}}libspirv.bc"{{.*}} "-mlink-builtin-bitcode" "{{.*}}libdevice{{.*}}.10.bc"{{.*}} "-target-feature" "+ptx42"{{.*}} "-target-sdk-version=[[CUDA_VERSION:[0-9.]+]]"{{.*}} "-target-cpu" "sm_50"{{.*}} "-std=c++11"{{.*}}
1212
// CHK-ACTIONS-NOT: "-mllvm -sycl-opt"
1313
// CHK-ACTIONS: clang-offload-wrapper"{{.*}} "-host=x86_64-unknown-linux-gnu" "-target=nvptx64" "-kind=sycl"{{.*}}
1414

clang/test/Driver/sycl-offload.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -926,4 +926,4 @@
926926
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHECK-HEADER-DIR
927927
// RUN: %clang_cl -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHECK-HEADER-DIR
928928
// CHECK-HEADER-DIR: clang{{.*}} "-fsycl-is-device"{{.*}} "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl" "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include"
929-
// CHECK-HEADER-DIR: clang{{.*}} "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl" "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include"{{.*}} "-fsycl-is-host"
929+
// CHECK-HEADER-DIR: clang{{.*}} "-fsycl-is-host"{{.*}} "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl" "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include"{{.*}}

clang/test/Driver/sycl-offload.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
/// Check that -fcoverage-mapping is disabled for device
2929
// RUN: %clang -### -fsycl -fprofile-instr-generate -fcoverage-mapping -target x86_64-unknown-linux-gnu -c %s 2>&1 \
3030
// RUN: | FileCheck -check-prefix=CHECK_COVERAGE_MAPPING %s
31-
// CHECK_COVERAGE_MAPPING: clang{{.*}} "-cc1" "-triple" "spir64-unknown-unknown-sycldevice" "-fsycl-is-device"{{.*}} "-fprofile-instrument=clang"
31+
// CHECK_COVERAGE_MAPPING: clang{{.*}} "-cc1" "-triple" "spir64-unknown-unknown-sycldevice"{{.*}} "-fsycl-is-device"{{.*}} "-fprofile-instrument=clang"
3232
// CHECK_COVERAGE_MAPPING-NOT: "-fcoverage-mapping"
33-
// CHECK_COVERAGE_MAPPING: clang{{.*}} "-cc1" "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fprofile-instrument=clang"
34-
// CHECK_COVERAGE_MAPPING: "-fcoverage-mapping"{{.*}} "-fsycl-is-host"
33+
// CHECK_COVERAGE_MAPPING: clang{{.*}} "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}} "-fsycl-is-host"{{.*}} "-fprofile-instrument=clang"{{.*}} "-fcoverage-mapping"{{.*}}

clang/test/Driver/sycl.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// RUN: %clangxx -### -fsycl-device-only -fsycl-unnamed-lambda %s 2>&1 | FileCheck %s --check-prefix=CHECK-LAMBDA
4040
// RUN: %clang_cl -### -fsycl-device-only -fsycl-unnamed-lambda %s 2>&1 | FileCheck %s --check-prefix=CHECK-LAMBDA
4141

42-
// DEFAULT: "-triple" "spir64-unknown-{{.*}}-sycldevice{{.*}}" "-fsycl-is-device"{{.*}} "-sycl-std=2020"{{.*}} "-emit-llvm-bc"
42+
// DEFAULT: "-triple" "spir64-unknown-{{.*}}-sycldevice"{{.*}} "-fsycl-is-device"{{.*}} "-sycl-std=2020"{{.*}} "-emit-llvm-bc"
4343
// DEFAULT: "-internal-isystem" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl"
4444
// DEFAULT: "-internal-isystem" "{{.*lib.*clang.*include}}"
4545
// DEFAULT: "-std=c++17"
@@ -48,7 +48,7 @@
4848
// DEFAULT-NOT: "-std=c++14"
4949
// NO-BITCODE: "-triple" "spir64-unknown-{{.*}}-sycldevice"{{.*}} "-fsycl-is-device"{{.*}} "-emit-llvm-bc"
5050
// NO-BITCODE: "{{.*}}llvm-spirv"{{.*}} "-spirv-max-version=1.3"{{.*}} "-spirv-ext=+all,-SPV_INTEL_usm_storage_classes,-SPV_INTEL_optnone,-SPV_KHR_linkonce_odr"
51-
// TARGET: "-triple" "spir64-unknown-linux-sycldevice"{{.*}} "-fsycl-is-device"{{.*}} "-emit-llvm-bc"
51+
// TARGET: "-triple" "spir64-unknown-linux-sycldevice"{{.*}} "-emit-llvm-bc"
5252
// COMBINED: "-triple" "spir64-unknown-{{.*}}-sycldevice"{{.*}} "-fsycl-is-device"{{.*}} "-emit-llvm-bc"
5353
// TEXTUAL: "-triple" "spir64-unknown-{{.*}}-sycldevice{{.*}}" "-fsycl-is-device"{{.*}} "-emit-llvm"
5454
// CHECK-LAMBDA: "-fsycl-unnamed-lambda"
@@ -58,13 +58,13 @@
5858
// RUN: | FileCheck --check-prefix=DEVICE-64 %s
5959
// RUN: %clang_cl -fsycl-device-only --target=x86_64-unknown-linux-gnu -### %s 2>&1 \
6060
// RUN: | FileCheck --check-prefix=DEVICE-64 %s
61-
// DEVICE-64: clang{{.*}} "-triple" "spir64-unknown-unknown-sycldevice" {{.*}} "-aux-triple" "x86_64-unknown-linux-gnu"
61+
// DEVICE-64: clang{{.*}} "-triple" "spir64-unknown-unknown-sycldevice" "-aux-triple" "x86_64-unknown-linux-gnu"
6262

6363
// RUN: %clang -fsycl-device-only -target i386-unknown-linux-gnu -### %s 2>&1 \
6464
// RUN: | FileCheck --check-prefix=DEVICE-32 %s
6565
// RUN: %clang_cl -fsycl-device-only --target=i386-unknown-linux-gnu -### %s 2>&1 \
6666
// RUN: | FileCheck --check-prefix=DEVICE-32 %s
67-
// DEVICE-32: clang{{.*}} "-triple" "spir-unknown-unknown-sycldevice" {{.*}} "-aux-triple" "i386-unknown-linux-gnu"
67+
// DEVICE-32: clang{{.*}} "-triple" "spir-unknown-unknown-sycldevice" "-aux-triple" "i386-unknown-linux-gnu"
6868

6969
/// Verify that the sycl header directory is before /usr/include
7070
// RUN: %clangxx -### -fsycl-device-only %s 2>&1 | FileCheck %s --check-prefix=HEADER_ORDER

0 commit comments

Comments
 (0)