diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index e1a3cbf6b1ade..b7b2d9b7c083f 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -6056,10 +6056,10 @@ def : Flag<["-"], "nocudainc">, Alias; def no_offloadlib : Flag<["--"], "no-offloadlib">, MarshallingInfoFlag>, - Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, + Visibility<[ClangOption, CLOption, CC1Option, FlangOption, FC1Option]>, HelpText<"Do not link device library for CUDA/HIP/SYCL device compilation">; def offloadlib : Flag<["--"], "offloadlib">, - Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, + Visibility<[ClangOption, CLOption, CC1Option, FlangOption, FC1Option]>, HelpText<"Link device libraries for GPU device compilation">; def : Flag<["-"], "nogpulib">, Alias, @@ -7268,23 +7268,6 @@ def fsycl_dead_args_optimization : Flag<["-"], "fsycl-dead-args-optimization">, HelpText<"Enables elimination of DPC++ dead kernel arguments">; def fno_sycl_dead_args_optimization : Flag<["-"], "fno-sycl-dead-args-optimization">, HelpText<"Disables elimination of DPC++ dead kernel arguments">; -def fsycl_device_lib_EQ : CommaJoined<["-"], "fsycl-device-lib=">, - Flags<[Deprecated]>, - Values<"libc,libm-fp32,libm-fp64,libimf-fp32,libimf-fp64,libimf-bf16,all">, - HelpText<"Control inclusion of device libraries into device binary linkage. " - "Valid arguments are libc, libm-fp32, libm-fp64, libimf-fp32, " - "libimf-fp64, libimf-bf16, all. (deprecated)">; -def fno_sycl_device_lib_EQ : CommaJoined<["-"], "fno-sycl-device-lib=">, - Flags<[Deprecated]>, - Values<"libc, libm-fp32, libm-fp64, all">, - HelpText<"Control exclusion of device libraries from device binary linkage. " - "Valid arguments are libc, libm-fp32, libm-fp64, all. (deprecated)">; -def fsycl_device_lib_jit_link : Flag<["-"], "fsycl-device-lib-jit-link">, - Flags<[Deprecated]>, - HelpText<"Enables sycl device library jit link. (deprecated)">; -def fno_sycl_device_lib_jit_link : Flag<["-"], "fno-sycl-device-lib-jit-link">, - Flags<[Deprecated]>, - HelpText<"Disables sycl device library jit link. (deprecated)">; def fsycl_fp32_prec_sqrt : Flag<["-"], "fsycl-fp32-prec-sqrt">, Alias, Flags<[Deprecated]>, Visibility<[ClangOption, CC1Option]>, HelpText<"SYCL only. Specify that " diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 73e3cc556c0fd..39ef74aaa2e0d 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -5496,13 +5496,8 @@ class OffloadingActionBuilder final { bool SYCLDeviceLibLinked = false; Action *NativeCPULib = nullptr; if (IsSPIR || IsNVPTX || IsAMDGCN || IsNativeCPU) { - bool UseJitLink = - IsSPIR && - Args.hasFlag(options::OPT_fsycl_device_lib_jit_link, - options::OPT_fno_sycl_device_lib_jit_link, false); - bool UseAOTLink = IsSPIR && (IsSpirvAOT || !UseJitLink); SYCLDeviceLibLinked = addSYCLDeviceLibs( - TC, SYCLDeviceLibs, UseAOTLink, + TC, SYCLDeviceLibs, IsSpirvAOT, C.getDefaultToolChain().getTriple().isWindowsMSVCEnvironment(), IsNativeCPU, NativeCPULib, BoundArch); } diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 90cad2bdbe6a5..434a39a58f27c 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -11281,15 +11281,9 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA, // Note: For AMD targets, we do not pass any SYCL device libraries. if (TC->getTriple().isSPIROrSPIRV() || TC->getTriple().isNVPTX()) { TargetTriple = TC->getTriple(); - SmallVector SYCLDeviceLibs; - bool IsSPIR = TargetTriple.isSPIROrSPIRV(); bool IsSpirvAOT = TargetTriple.isSPIRAOT(); - bool UseJitLink = - IsSPIR && - Args.hasFlag(options::OPT_fsycl_device_lib_jit_link, - options::OPT_fno_sycl_device_lib_jit_link, false); - bool UseAOTLink = IsSPIR && (IsSpirvAOT || !UseJitLink); - SYCLDeviceLibs = SYCL::getDeviceLibraries(C, TargetTriple, UseAOTLink); + SmallVector SYCLDeviceLibs = + SYCL::getDeviceLibraries(C, TargetTriple, IsSpirvAOT); for (const auto &AddLib : SYCLDeviceLibs) { if (LibList.size() > 0) LibList += ","; diff --git a/clang/lib/Driver/ToolChains/SYCL.cpp b/clang/lib/Driver/ToolChains/SYCL.cpp index f26a1374217d3..40b84e11498b2 100644 --- a/clang/lib/Driver/ToolChains/SYCL.cpp +++ b/clang/lib/Driver/ToolChains/SYCL.cpp @@ -561,202 +561,12 @@ addSYCLDeviceSanitizerLibs(const Compilation &C, bool IsSpirvAOT, } #endif -// Get the list of SYCL device libraries to link with user's device image if -// some deprecated options are used including: -f[no-]sycl-device-lib=xxx, -// -f[no-]sycl-device-lib-jit-link. -// TODO: remove getDeviceLibrariesLegacy when we remove deprecated options -// related to sycl device library link. -static SmallVector -getDeviceLibrariesLegacy(const Compilation &C, const llvm::Triple &TargetTriple, - bool IsSpirvAOT) { - SmallVector LibraryList; - const llvm::opt::ArgList &Args = C.getArgs(); - - // For NVPTX and AMDGCN we only use one single bitcode library and ignore - // manually specified SYCL device libraries. - // For NativeCPU, only native_utils devicelib is used. - bool UseSingleLib = TargetTriple.isNVPTX() || TargetTriple.isAMDGCN() || - TargetTriple.isNativeCPU(); - bool IgnoreSingleLib = false; - - struct DeviceLibOptInfo { - StringRef DeviceLibName; - StringRef DeviceLibOption; - }; - - enum { JIT = 0, AOT_CPU, AOT_DG2, AOT_PVC }; - - // Currently, all SYCL device libraries will be linked by default. - llvm::StringMap DeviceLibLinkInfo = { - {"libc", true}, {"libm-fp32", true}, {"libm-fp64", true}, - {"libimf-fp32", true}, {"libimf-fp64", true}, {"libimf-bf16", true}, - {"libm-bfloat16", true}, {"internal", true}}; - - // If -fno-sycl-device-lib is specified, its values will be used to exclude - // linkage of libraries specified by DeviceLibLinkInfo. Linkage of "internal" - // libraries cannot be affected via -fno-sycl-device-lib. - bool ExcludeDeviceLibs = false; - - if (Arg *A = Args.getLastArg(options::OPT_fsycl_device_lib_EQ, - options::OPT_fno_sycl_device_lib_EQ)) { - if (A->getValues().size() == 0) - C.getDriver().Diag(diag::warn_drv_empty_joined_argument) - << A->getAsString(Args); - else { - if (A->getOption().matches(options::OPT_fno_sycl_device_lib_EQ)) - ExcludeDeviceLibs = true; - - // When single libraries are ignored and a subset of library names - // not containing the value "all" is specified by -fno-sycl-device-lib, - // print an unused argument warning. - bool PrintUnusedExcludeWarning = false; - - for (StringRef Val : A->getValues()) { - if (Val == "all") { - PrintUnusedExcludeWarning = false; - - // Make sure that internal libraries are still linked against - // when -fno-sycl-device-lib contains "all" and single libraries - // should be ignored. For NativeCPU, the native_cpu utils library - // is always linked without '-only-needed' flag. - IgnoreSingleLib = - UseSingleLib && ExcludeDeviceLibs && !TargetTriple.isNativeCPU(); - - for (const auto &K : DeviceLibLinkInfo.keys()) - DeviceLibLinkInfo[K] = (K == "internal") || !ExcludeDeviceLibs; - break; - } - auto LinkInfoIter = DeviceLibLinkInfo.find(Val); - if (LinkInfoIter == DeviceLibLinkInfo.end() || Val == "internal") { - // TODO: Move the diagnostic to the SYCL section of - // Driver::CreateOffloadingDeviceToolChains() to minimize code - // duplication. - C.getDriver().Diag(diag::err_drv_unsupported_option_argument) - << A->getSpelling() << Val; - } - DeviceLibLinkInfo[Val] = !ExcludeDeviceLibs; - PrintUnusedExcludeWarning = UseSingleLib && ExcludeDeviceLibs; - } - if (PrintUnusedExcludeWarning) - C.getDriver().Diag(diag::warn_drv_unused_argument) << A->getSpelling(); - } - } - - if (TargetTriple.isNVPTX() && !IgnoreSingleLib) - LibraryList.push_back( - Args.MakeArgString("devicelib-nvptx64-nvidia-cuda.bc")); - - if (TargetTriple.isAMDGCN() && !IgnoreSingleLib) - LibraryList.push_back(Args.MakeArgString("devicelib-amdgcn-amd-amdhsa.bc")); - - if (TargetTriple.isNativeCPU() && !IgnoreSingleLib) - LibraryList.push_back(Args.MakeArgString("libsycl-nativecpu_utils.bc")); - - if (UseSingleLib) - return LibraryList; - - using SYCLDeviceLibsList = SmallVector; - - const SYCLDeviceLibsList SYCLDeviceWrapperLibs = { - {"libsycl-crt", "libc"}, - {"libsycl-complex", "libm-fp32"}, - {"libsycl-complex-fp64", "libm-fp64"}, - {"libsycl-cmath", "libm-fp32"}, - {"libsycl-cmath-fp64", "libm-fp64"}, -#if defined(_WIN32) - {"libsycl-msvc-math", "libm-fp32"}, -#endif - {"libsycl-imf", "libimf-fp32"}, - {"libsycl-imf-fp64", "libimf-fp64"}, - {"libsycl-imf-bf16", "libimf-bf16"}}; - // For AOT compilation, we need to link sycl_device_fallback_libs as - // default too. - const SYCLDeviceLibsList SYCLDeviceFallbackLibs = { - {"libsycl-fallback-cassert", "libc"}, - {"libsycl-fallback-cstring", "libc"}, - {"libsycl-fallback-complex", "libm-fp32"}, - {"libsycl-fallback-complex-fp64", "libm-fp64"}, - {"libsycl-fallback-cmath", "libm-fp32"}, - {"libsycl-fallback-cmath-fp64", "libm-fp64"}, - {"libsycl-fallback-imf", "libimf-fp32"}, - {"libsycl-fallback-imf-fp64", "libimf-fp64"}, - {"libsycl-fallback-imf-bf16", "libimf-bf16"}}; - const SYCLDeviceLibsList SYCLDeviceBfloat16FallbackLib = { - {"libsycl-fallback-bfloat16", "libm-bfloat16"}}; - const SYCLDeviceLibsList SYCLDeviceBfloat16NativeLib = { - {"libsycl-native-bfloat16", "libm-bfloat16"}}; - // ITT annotation libraries are linked in separately whenever the device - // code instrumentation is enabled. - const SYCLDeviceLibsList SYCLDeviceAnnotationLibs = { - {"libsycl-itt-user-wrappers", "internal"}, - {"libsycl-itt-compiler-wrappers", "internal"}, - {"libsycl-itt-stubs", "internal"}}; - const SYCLDeviceLibsList SYCLNativeCpuDeviceLibs = { - {"libsycl-nativecpu_utils", "internal"}}; - - bool IsWindowsMSVCEnv = - C.getDefaultToolChain().getTriple().isWindowsMSVCEnvironment(); - bool IsNewOffload = C.getDriver().getUseNewOffloadingDriver(); - StringRef LibSuffix = ".bc"; - if (IsNewOffload) - // For new offload model, we use packaged .bc files. - LibSuffix = IsWindowsMSVCEnv ? ".new.obj" : ".new.o"; - auto addLibraries = [&](const SYCLDeviceLibsList &LibsList) { - for (const DeviceLibOptInfo &Lib : LibsList) { - if (!DeviceLibLinkInfo[Lib.DeviceLibOption]) - continue; - SmallString<128> LibName(Lib.DeviceLibName); - llvm::sys::path::replace_extension(LibName, LibSuffix); - LibraryList.push_back(Args.MakeArgString(LibName)); - } - }; - - addLibraries(SYCLDeviceWrapperLibs); - if (IsSpirvAOT) - addLibraries(SYCLDeviceFallbackLibs); - - bool NativeBfloatLibs; - bool NeedBfloatLibs = selectBfloatLibs(TargetTriple, C, NativeBfloatLibs); - if (NeedBfloatLibs) { - // Add native or fallback bfloat16 library. - if (NativeBfloatLibs) - addLibraries(SYCLDeviceBfloat16NativeLib); - else - addLibraries(SYCLDeviceBfloat16FallbackLib); - } - - // Link in ITT annotations library unless fsycl-no-instrument-device-code - // is specified. This ensures that we are ABI-compatible with the - // instrumented device code, which was the default not so long ago. - if (Args.hasFlag(options::OPT_fsycl_instrument_device_code, - options::OPT_fno_sycl_instrument_device_code, true)) - addLibraries(SYCLDeviceAnnotationLibs); - - // Currently, device sanitizer support is required by some developers on - // Linux platform only, so compiler only provides device sanitizer libraries - // on Linux platform. -#if !defined(_WIN32) - addSYCLDeviceSanitizerLibs(C, IsSpirvAOT, LibSuffix, LibraryList); -#endif - - if (TargetTriple.isNativeCPU()) - addLibraries(SYCLNativeCpuDeviceLibs); - - return LibraryList; -} - // Get the list of SYCL device libraries to link with user's device image. SmallVector SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple, bool IsSpirvAOT) { SmallVector LibraryList; const llvm::opt::ArgList &Args = C.getArgs(); - if (Args.getLastArg(options::OPT_fsycl_device_lib_EQ, - options::OPT_fno_sycl_device_lib_EQ) || - Args.getLastArg(options::OPT_fsycl_device_lib_jit_link, - options::OPT_fno_sycl_device_lib_jit_link)) - return getDeviceLibrariesLegacy(C, TargetTriple, IsSpirvAOT); - bool NoOffloadLib = !Args.hasFlag(options::OPT_offloadlib, options::OPT_no_offloadlib, true); if (TargetTriple.isNVPTX()) { diff --git a/clang/test/Driver/sycl-deprecated.cpp b/clang/test/Driver/sycl-deprecated.cpp index 537f56c7121cf..ae71f69684a60 100644 --- a/clang/test/Driver/sycl-deprecated.cpp +++ b/clang/test/Driver/sycl-deprecated.cpp @@ -12,11 +12,3 @@ // RUN: %clangxx -fsycl -fsycl-fp32-prec-sqrt %s -### 2>&1 | FileCheck %s --check-prefix=CHECK_REPLACE -DOPTION=-fsycl-fp32-prec-sqrt -DOPTION_REPLACE=-foffload-fp32-prec-sqrt // RUN: %clangxx -fsycl -fsycl-dump-device-code=/path/to/spv/ %s -### 2>&1 | FileCheck %s --check-prefix=CHECK_REPLACE -DOPTION=-fsycl-dump-device-code=/path/to/spv/ -DOPTION_REPLACE=-save-offload-code=/path/to/spv/ // CHECK_REPLACE: option '[[OPTION]]' is deprecated and will be removed in a future release, use '[[OPTION_REPLACE]]' instead - -// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -### 2>&1 \ -// RUN: | FileCheck %s --check-prefix=CHECK -DOPTION=-fsycl-device-lib-jit-link -// RUN: %clangxx -fsycl -fsycl-device-lib=libc %s -### 2>&1 \ -// RUN: | FileCheck %s --check-prefix=CHECK -DOPTION=-fsycl-device-lib=libc -// RUN: %clangxx -fsycl -fno-sycl-device-lib=libc %s -### 2>&1 \ -// RUN: | FileCheck %s --check-prefix=CHECK -DOPTION=-fno-sycl-device-lib=libc - diff --git a/clang/test/Driver/sycl-device-lib-amdgcn.cpp b/clang/test/Driver/sycl-device-lib-amdgcn.cpp index 1eb6616df9c1e..a02a35db48d3f 100644 --- a/clang/test/Driver/sycl-device-lib-amdgcn.cpp +++ b/clang/test/Driver/sycl-device-lib-amdgcn.cpp @@ -4,29 +4,6 @@ // UNSUPPORTED: system-windows -// Check that the -fsycl-device-lib flag has no effect when "all" is specified. -// RUN: %clangxx -ccc-print-phases -std=c++11 -fsycl -fsycl-device-lib=all --sysroot=%S/Inputs/SYCL \ -// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHK-ALL %s - -// Check that the -fsycl-device-lib flag has no effect when subsets of libs -// are specified. -// RUN: %clangxx -ccc-print-phases -std=c++11 --sysroot=%S/Inputs/SYCL \ -// RUN: -fsycl -fsycl-device-lib=libc,libm-fp32,libm-fp64,libimf-fp32,libimf-fp64,libimf-bf16,libm-bfloat16 \ -// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHK-ALL %s - -// Check that -fno-sycl-device-lib is ignored when it does not contain "all". -// A warning should be printed that the flag got ignored. -// RUN: %clangxx -ccc-print-phases -std=c++11 -fsycl --sysroot=%S/Inputs/SYCL \ -// RUN: -fno-sycl-device-lib=libc,libm-fp32,libm-fp64,libimf-fp32,libimf-fp64,libimf-bf16,libm-bfloat16 \ -// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ -// RUN: | FileCheck -check-prefixes=CHK-UNUSED-WARN,CHK-ALL %s - -// CHK-UNUSED-WARN: warning: argument unused during compilation: '-fno-sycl-device-lib=' -// CHK-ALL: [[DEVLIB:[0-9]+]]: input, "{{.*}}devicelib-amdgcn-amd-amdhsa.bc", ir, (device-sycl, gfx906) -// CHK-ALL: {{[0-9]+}}: linker, {{{.*}}[[DEVLIB]]{{.*}}}, ir, (device-sycl, gfx906) - // Check that llvm-link uses the "-only-needed" flag. // Not using the flag breaks kernel bundles. // RUN: %clangxx -### -fsycl -fsycl-targets=amdgcn-amd-amdhsa -fno-sycl-libspirv --sysroot=%S/Inputs/SYCL \ diff --git a/clang/test/Driver/sycl-device-lib-nvptx.cpp b/clang/test/Driver/sycl-device-lib-nvptx.cpp index c7c25c5ff6624..232c693d4069e 100644 --- a/clang/test/Driver/sycl-device-lib-nvptx.cpp +++ b/clang/test/Driver/sycl-device-lib-nvptx.cpp @@ -4,29 +4,6 @@ // UNSUPPORTED: system-windows -// Check that the -fsycl-device-lib flag has no effect when "all" is specified. -// RUN: %clangxx -ccc-print-phases -std=c++11 -fsycl -fsycl-device-lib=all --sysroot=%S/Inputs/SYCL \ -// RUN: -fsycl-targets=nvptx64-nvidia-cuda %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHK-ALL %s - -// Check that the -fsycl-device-lib flag has no effect when subsets of libs -// are specified. -// RUN: %clangxx -ccc-print-phases -std=c++11 --sysroot=%S/Inputs/SYCL \ -// RUN: -fsycl -fsycl-device-lib=libc,libm-fp32,libm-fp64,libimf-fp32,libimf-fp64,libimf-bf16,libm-bfloat16 \ -// RUN: -fsycl-targets=nvptx64-nvidia-cuda %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHK-ALL %s - -// Check that -fno-sycl-device-lib is ignored when it does not contain "all". -// A warning should be printed that the flag got ignored. -// RUN: %clangxx -ccc-print-phases -std=c++11 -fsycl --sysroot=%S/Inputs/SYCL \ -// RUN: -fno-sycl-device-lib=libc,libm-fp32,libm-fp64,libimf-fp32,libimf-fp64,libimf-bf16,libm-bfloat16 \ -// RUN: -fsycl-targets=nvptx64-nvidia-cuda %s 2>&1 \ -// RUN: | FileCheck -check-prefixes=CHK-UNUSED-WARN,CHK-ALL %s - -// CHK-UNUSED-WARN: warning: argument unused during compilation: '-fno-sycl-device-lib=' -// CHK-ALL: [[DEVLIB:[0-9]+]]: input, "{{.*}}devicelib-nvptx64-nvidia-cuda.bc", ir, (device-sycl, sm_50) -// CHK-ALL: {{[0-9]+}}: linker, {{{.*}}[[DEVLIB]]{{.*}}}, ir, (device-sycl, sm_50) - // Check that llvm-link uses the "-only-needed" flag. // Not using the flag breaks kernel bundles. // RUN: %clangxx -### --cuda-path=%S/Inputs/CUDA/usr/local/cuda -fno-sycl-libspirv --sysroot=%S/Inputs/SYCL \ diff --git a/clang/test/Driver/sycl-device-lib-old-model.cpp b/clang/test/Driver/sycl-device-lib-old-model.cpp index b7b85d9a07d05..bbeab2ebab2d5 100644 --- a/clang/test/Driver/sycl-device-lib-old-model.cpp +++ b/clang/test/Driver/sycl-device-lib-old-model.cpp @@ -6,19 +6,9 @@ /// ########################################################################### -/// test behavior of device library default link and fno-sycl-device-lib-jit-link +/// test behavior of device library default link // RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-device-lib-jit-link %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=libc --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-device-lib-jit-link %s -fsycl-device-lib=libc --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=libc,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT // SYCL_DEVICE_LIB_LINK_DEFAULT: llvm-link{{.*}} "{{.*}}libsycl-crt.bc" // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: "{{.*}}libsycl-complex.bc" // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: "{{.*}}libsycl-complex-fp64.bc" @@ -37,102 +27,9 @@ // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc" // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" -/// ########################################################################### -/// test sycl fallback device libraries are not linked by default -// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-device-lib-jit-link %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_NO_FALLBACK -// SYCL_DEVICE_LIB_NO_FALLBACK: llvm-link{{.*}} "{{.*}}libsycl-crt.bc" -// SYCL_DEVICE_LIB_NO_FALLBACK-NOT: "{{.*}}libsycl-fallback-{{.*}}.bc" - -/// ########################################################################### -/// test behavior of device library link with libm-fp64 -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=libc,libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=libc,libm-fp32,libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=libc,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// SYCL_DEVICE_LIB_LINK_WITH_FP64: llvm-link{{.*}} "{{.*}}libsycl-crt.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-complex.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-cmath.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-imf.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-imf-bf16.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-cassert.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-cstring.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-complex.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-cmath.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-imf.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" -/// ########################################################################### - -/// test behavior of -fno-sycl-device-lib=libc -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=libc --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_LIBC -// SYCL_DEVICE_LIB_LINK_NO_LIBC: llvm-link{{.*}} -// SYCL_DEVICE_LIB_LINK_NO_LIBC-NOT: "{{.*}}libsycl-crt.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC: "{{.*}}libsycl-complex.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-cmath.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-imf.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-imf-bf16.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-NOT: "{{.*}}libsycl-fallback-cassert.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-NOT: "{{.*}}libsycl-fallback-cstring.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-complex.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-cmath.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-imf.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" -/// ########################################################################### - -/// test behavior of -fno-sycl-device-lib=libm-fp32,libm-fp64 -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=libm-fp32,libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_LIBM -// SYCL_DEVICE_LIB_LINK_NO_LIBM: llvm-link{{.*}} "{{.*}}libsycl-crt.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-complex.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-cmath.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-imf.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-imf-bf16.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-cassert.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-cstring.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-fallback-complex.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-fallback-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-fallback-cmath.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-fallback-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-imf.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" /// ########################################################################### /// test behavior of disabling all device libraries -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=libc,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=libc,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=libm-fp32,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=libm-fp64,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=libc,all,libm-fp64,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB // RUN: %clangxx -fsycl --no-offload-new-driver %s --no-offloadlib --sysroot=%S/Inputs/SYCL -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB // SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB: {{.*}}clang{{.*}} "-cc1" "-triple" "spir64-unknown-unknown" @@ -140,20 +37,6 @@ /// ########################################################################### -/// test invalid value for -f[no-]sycl-device-lib -// RUN: not %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=libc,dummy -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_INVALID_VALUE -DVal=dummy -// RUN: not %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=dummy,libm-fp32 -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_NO_DEVICE_LIB_INVALID_VALUE -DVal=dummy -// Do separate checks for the compiler-reserved "internal" value -// RUN: not %clangxx -fsycl --no-offload-new-driver %s -fsycl-device-lib=internal -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_INVALID_VALUE -DVal=internal -// RUN: not %clangxx -fsycl --no-offload-new-driver %s -fno-sycl-device-lib=internal -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_NO_DEVICE_LIB_INVALID_VALUE -DVal=internal -// SYCL_DEVICE_LIB_INVALID_VALUE: error: unsupported argument '[[Val]]' to option '-fsycl-device-lib=' -// SYCL_NO_DEVICE_LIB_INVALID_VALUE: error: unsupported argument '[[Val]]' to option '-fno-sycl-device-lib=' - -/// ########################################################################### /// test llvm-link behavior for linking device libraries // RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=SYCL_LLVM_LINK_DEVICE_LIB @@ -182,14 +65,7 @@ // SYCL_LLVM_LINK_DEVICE_LIB-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" /// ########################################################################### -/// test llvm-link behavior for fno-sycl-device-lib -// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-dead-args-optimization -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_LLVM_LINK_NO_DEVICE_LIB -// SYCL_LLVM_LINK_NO_DEVICE_LIB: clang{{.*}} "-cc1" {{.*}} "-fsycl-is-device" -// SYCL_LLVM_LINK_NO_DEVICE_LIB-NOT: llvm-link{{.*}} "-only-needed" -// SYCL_LLVM_LINK_NO_DEVICE_LIB: sycl-post-link{{.*}} "-symbols" "-emit-exported-symbols" "-emit-imported-symbols"{{.*}} "-o" "{{.*}}.table" "{{.*}}.bc" -/// ########################################################################### /// test llvm-link behavior for special user input whose filename resembles SYCL device library // RUN: touch libsycl-crt.o // RUN: %clangxx -fsycl --no-offload-new-driver libsycl-crt.o --sysroot=%S/Inputs/SYCL -### 2>&1 \ diff --git a/clang/test/Driver/sycl-device-lib-win.cpp b/clang/test/Driver/sycl-device-lib-win.cpp index 65cbc111526ae..52acff226fc95 100644 --- a/clang/test/Driver/sycl-device-lib-win.cpp +++ b/clang/test/Driver/sycl-device-lib-win.cpp @@ -6,19 +6,9 @@ /// ########################################################################### -/// test behavior of device library default link and fno-sycl-device-lib-jit-link +/// test behavior of device library default link // RUN: %clangxx -fsycl %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl -fno-sycl-device-lib-jit-link %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl %s -fsycl-device-lib=libc --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl -fno-sycl-device-lib-jit-link %s -fsycl-device-lib=libc --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl %s -fsycl-device-lib=libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl %s -fsycl-device-lib=libc,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT // SYCL_DEVICE_LIB_LINK_DEFAULT: llvm-link{{.*}} "{{.*}}libsycl-crt.bc" // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: "{{.*}}libsycl-complex.bc" // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: "{{.*}}libsycl-complex-fp64.bc" @@ -38,121 +28,15 @@ // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" /// ########################################################################### -/// test sycl fallback device libraries are not linked when using jit link. -// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_NO_FALLBACK -// SYCL_DEVICE_LIB_NO_FALLBACK: llvm-link{{.*}} "{{.*}}libsycl-crt.bc" -// SYCL_DEVICE_LIB_NO_FALLBACK-NOT: "{{.*}}libsycl-fallback-{{.*}}.bc" - -/// ########################################################################### -/// test behavior of device library link with libm-fp64 -// RUN: %clangxx -fsycl %s -fsycl-device-lib=libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl %s -fsycl-device-lib=libc,libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl %s -fsycl-device-lib=all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl %s -fsycl-device-lib=libc,libm-fp32,libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl %s -fsycl-device-lib=libc,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// SYCL_DEVICE_LIB_LINK_WITH_FP64: llvm-link{{.*}} "{{.*}}libsycl-crt.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-complex.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-cmath.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-imf.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-imf-bf16.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-cassert.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-cstring.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-complex.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-cmath.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-imf.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" - -/// ########################################################################### -/// test behavior of -fno-sycl-device-lib=libc -// RUN: %clangxx -fsycl %s -fno-sycl-device-lib=libc --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_LIBC -// SYCL_DEVICE_LIB_LINK_NO_LIBC: llvm-link{{.*}} -// SYCL_DEVICE_LIB_LINK_NO_LIBC-NOT: "{{.*}}libsycl-crt.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC: "{{.*}}libsycl-complex.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-cmath.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-imf.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-imf-bf16.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-NOT: "{{.*}}libsycl-fallback-cassert.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-NOT: "{{.*}}libsycl-fallback-cstring.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-complex.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-cmath.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-imf.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" - -/// ########################################################################### -/// test behavior of -fno-sycl-device-lib=libm-fp32,libm-fp64 -// RUN: %clangxx -fsycl %s -fno-sycl-device-lib=libm-fp32,libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_LIBM -// SYCL_DEVICE_LIB_LINK_NO_LIBM: llvm-link{{.*}} "{{.*}}libsycl-crt.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-complex.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-cmath.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-imf.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-imf-bf16.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-cassert.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-cstring.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-fallback-complex.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-fallback-complex-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-fallback-cmath.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: "{{.*}}libsycl-fallback-cmath-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-imf.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc" -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" -/// ########################################################################### /// test behavior of disabling all device libraries -// RUN: %clangxx -fsycl %s -fno-sycl-device-lib=libc,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl %s -fno-sycl-device-lib=all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl %s -fno-sycl-device-lib=libc,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl %s -fno-sycl-device-lib=libm-fp32,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl %s -fno-sycl-device-lib=libm-fp64,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl %s -fno-sycl-device-lib=libc,all,libm-fp64,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB // RUN: %clangxx -fsycl %s --no-offloadlib --sysroot=%S/Inputs/SYCL -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB // SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB: {{.*}}clang{{.*}} "-cc1" "-triple" "spir64-unknown-unknown" // SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB-NOT: libsycl-cmath.bc /// ########################################################################### -/// test invalid value for -f[no-]sycl-device-lib -// RUN: not %clangxx -fsycl %s -fsycl-device-lib=libc,dummy --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_INVALID_VALUE -DVal=dummy -// RUN: not %clangxx -fsycl %s -fno-sycl-device-lib=dummy,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_NO_DEVICE_LIB_INVALID_VALUE -DVal=dummy -// Do separate checks for the compiler-reserved "internal" value -// RUN: not %clangxx -fsycl %s -fsycl-device-lib=internal --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_INVALID_VALUE -DVal=internal -// RUN: not %clangxx -fsycl %s -fno-sycl-device-lib=internal --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_NO_DEVICE_LIB_INVALID_VALUE -DVal=internal -// SYCL_DEVICE_LIB_INVALID_VALUE: error: unsupported argument '[[Val]]' to option '-fsycl-device-lib=' -// SYCL_NO_DEVICE_LIB_INVALID_VALUE: error: unsupported argument '[[Val]]' to option '-fno-sycl-device-lib=' -/// ########################################################################### /// test llvm-link behavior for linking device libraries // RUN: %clangxx -fsycl %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=SYCL_LLVM_LINK_DEVICE_LIB @@ -178,14 +62,6 @@ // SYCL_LLVM_LINK_DEVICE_LIB-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc" // SYCL_LLVM_LINK_DEVICE_LIB-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc" -/// ########################################################################### -/// test llvm-link behavior for fno-sycl-device-lib -// RUN: %clangxx -fsycl -fno-sycl-dead-args-optimization -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_LLVM_LINK_NO_DEVICE_LIB -// SYCL_LLVM_LINK_NO_DEVICE_LIB: clang{{.*}} "-cc1" {{.*}} "-fsycl-is-device" -// SYCL_LLVM_LINK_NO_DEVICE_LIB-NOT: llvm-link{{.*}} "-only-needed" -// SYCL_LLVM_LINK_NO_DEVICE_LIB: sycl-post-link{{.*}} "-spec-const=native" {{.*}} "-o" "{{.*}}.table" "{{.*}}.bc" - /// ########################################################################### /// test clang-cl behavior for linking sycl-devicelib-host.lib by default // RUN: %clang_cl -fsycl %s /winsysroot=%S/Inputs/SYCL -### 2>&1 \ diff --git a/clang/test/Driver/sycl-device-lib.cpp b/clang/test/Driver/sycl-device-lib.cpp index da0ba26b270dd..7aa05f6dca8e6 100644 --- a/clang/test/Driver/sycl-device-lib.cpp +++ b/clang/test/Driver/sycl-device-lib.cpp @@ -6,19 +6,9 @@ /// ########################################################################### -/// test behavior of device library default link and fno-sycl-device-lib-jit-link +/// test behavior of device library default link // RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --offload-new-driver -fno-sycl-device-lib-jit-link %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=libc --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --offload-new-driver -fno-sycl-device-lib-jit-link %s -fsycl-device-lib=libc --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT -// RUN: %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=libc,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_DEFAULT // SYCL_DEVICE_LIB_LINK_DEFAULT: clang-linker-wrapper{{.*}} "-sycl-device-libraries=libsycl-crt.new.o // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: {{.*}}libsycl-complex.new.o // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: {{.*}}libsycl-complex-fp64.new.o @@ -37,103 +27,9 @@ // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: {{.*}}libsycl-fallback-imf-fp64.new.o // SYCL_DEVICE_LIB_LINK_DEFAULT-SAME: {{.*}}libsycl-fallback-imf-bf16.new.o -/// ########################################################################### -/// test sycl fallback device libraries are not linked by default -// RUN: %clangxx -fsycl --offload-new-driver -fsycl-device-lib-jit-link %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_NO_FALLBACK -// SYCL_DEVICE_LIB_NO_FALLBACK: clang-linker-wrapper{{.*}} "-sycl-device-libraries=libsycl-crt.new.o -// SYCL_DEVICE_LIB_NO_FALLBACK-NOT: libsycl-fallback - -/// ########################################################################### -/// test behavior of device library link with libm-fp64 -// RUN: %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=libc,libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=libc,libm-fp32,libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// RUN: %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=libc,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_WITH_FP64 -// SYCL_DEVICE_LIB_LINK_WITH_FP64: clang-linker-wrapper{{.*}} "-sycl-device-libraries=libsycl-crt.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-complex.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-complex-fp64.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-cmath.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-cmath-fp64.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-imf.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-imf-fp64.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-imf-bf16.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-fallback-cassert.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-fallback-cstring.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-fallback-complex.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-fallback-complex-fp64.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-fallback-cmath.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-fallback-cmath-fp64.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-fallback-imf.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-fallback-imf-fp64.new.o -// SYCL_DEVICE_LIB_LINK_WITH_FP64-SAME: {{.*}}libsycl-fallback-imf-bf16.new.o -/// ########################################################################### - -/// test behavior of -fno-sycl-device-lib=libc -// RUN: %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=libc --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_LIBC -// SYCL_DEVICE_LIB_LINK_NO_LIBC: clang-linker-wrapper{{.*}} "-sycl-device-libraries -// SYCL_DEVICE_LIB_LINK_NO_LIBC-NOT: {{.*}}libsycl-crt.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC: {{.*}}libsycl-complex.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-complex-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-cmath.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-cmath-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-imf.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-imf-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-imf-bf16.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-NOT: {{.*}}libsycl-fallback-cassert.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-NOT: {{.*}}libsycl-fallback-cstring.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-fallback-complex.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-fallback-complex-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-fallback-cmath.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-fallback-cmath-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-fallback-imf.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-fallback-imf-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBC-SAME: {{.*}}libsycl-fallback-imf-bf16.new.o -/// ########################################################################### - -/// test behavior of -fno-sycl-device-lib=libm-fp32,libm-fp64 -// RUN: %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=libm-fp32,libm-fp64 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_LIBM -// SYCL_DEVICE_LIB_LINK_NO_LIBM: clang-linker-wrapper{{.*}} "-sycl-device-libraries -// SYCL_DEVICE_LIB_LINK_NO_LIBM: {{.*}}libsycl-crt.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: {{.*}}libsycl-complex.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: {{.*}}libsycl-complex-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: {{.*}}libsycl-cmath.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: {{.*}}libsycl-cmath-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: {{.*}}libsycl-imf.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: {{.*}}libsycl-imf-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: {{.*}}libsycl-imf-bf16.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: {{.*}}libsycl-fallback-cassert.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: {{.*}}libsycl-fallback-cstring.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: {{.*}}libsycl-fallback-complex.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: {{.*}}libsycl-fallback-complex-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: {{.*}}libsycl-fallback-cmath.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-NOT: {{.*}}libsycl-fallback-cmath-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: {{.*}}libsycl-fallback-imf.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: {{.*}}libsycl-fallback-imf-fp64.new.o -// SYCL_DEVICE_LIB_LINK_NO_LIBM-SAME: {{.*}}libsycl-fallback-imf-bf16.new.o /// ########################################################################### /// test behavior of disabling all device libraries -// RUN: %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=libc,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=libc,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=libm-fp32,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=libm-fp64,all --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB -// RUN: %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=libc,all,libm-fp64,libm-fp32 --sysroot=%S/Inputs/SYCL -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB // RUN: %clangxx -fsycl --offload-new-driver %s --no-offloadlib --sysroot=%S/Inputs/SYCL -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB // SYCL_DEVICE_LIB_LINK_NO_DEVICE_LIB: {{.*}}clang{{.*}} "-cc1" "-triple" "spir64-unknown-unknown" @@ -141,20 +37,6 @@ /// ########################################################################### -/// test invalid value for -f[no-]sycl-device-lib -// RUN: not %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=libc,dummy -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_INVALID_VALUE -DVal=dummy -// RUN: not %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=dummy,libm-fp32 -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_NO_DEVICE_LIB_INVALID_VALUE -DVal=dummy -// Do separate checks for the compiler-reserved "internal" value -// RUN: not %clangxx -fsycl --offload-new-driver %s -fsycl-device-lib=internal -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_INVALID_VALUE -DVal=internal -// RUN: not %clangxx -fsycl --offload-new-driver %s -fno-sycl-device-lib=internal -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix=SYCL_NO_DEVICE_LIB_INVALID_VALUE -DVal=internal -// SYCL_DEVICE_LIB_INVALID_VALUE: error: unsupported argument '[[Val]]' to option '-fsycl-device-lib=' -// SYCL_NO_DEVICE_LIB_INVALID_VALUE: error: unsupported argument '[[Val]]' to option '-fno-sycl-device-lib=' - -/// ########################################################################### /// test behavior of libsycl-asan.o linking when -fsanitize=address is available // RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -fsanitize=address -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN diff --git a/clang/test/Driver/sycl-early-device-link-old-model.cpp b/clang/test/Driver/sycl-early-device-link-old-model.cpp index 0e97a1353f0ad..89436ec38a1df 100644 --- a/clang/test/Driver/sycl-early-device-link-old-model.cpp +++ b/clang/test/Driver/sycl-early-device-link-old-model.cpp @@ -23,7 +23,7 @@ // RUN: %clangxx -c -fno-sycl-rdc -fsycl --no-offload-new-driver -fsycl-targets=spir64_gen \ // RUN: --target=x86_64-unknown-linux-gnu -Xsycl-target-backend \ // RUN: "-device skl" --sysroot=%S/Inputs/SYCL -ccc-print-phases %s \ -// RUN: -fsycl-instrument-device-code -fno-sycl-device-lib=all 2>&1 \ +// RUN: -fsycl-instrument-device-code --no-offloadlib 2>&1 \ // RUN: | FileCheck %s -check-prefix=CREATE_IMAGE_PHASES // CREATE_IMAGE_PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (device-sycl) // CREATE_IMAGE_PHASES: 1: preprocessor, {0}, c++-cpp-output, (device-sycl) @@ -51,7 +51,7 @@ // Use of -fno-sycl-rdc -c with non-AOT should not perform the device link. // RUN: %clangxx -c -fno-sycl-rdc -fsycl --no-offload-new-driver -fsycl-targets=spir64 \ // RUN: --target=x86_64-unknown-linux-gnu -ccc-print-phases %s \ -// RUN: -fno-sycl-device-lib=all 2>&1 \ +// RUN: --no-offloadlib 2>&1 \ // RUN: | FileCheck %s -check-prefix=JIT_ONLY_PHASES // JIT_ONLY_PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (device-sycl) // JIT_ONLY_PHASES: 1: preprocessor, {0}, c++-cpp-output, (device-sycl) @@ -70,7 +70,7 @@ // RUN: %clangxx -c -fno-sycl-rdc -fsycl --no-offload-new-driver -fsycl-targets=spir64,spir64_gen \ // RUN: --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/SYCL \ // RUN: -Xsycl-target-backend=spir64_gen "-device skl" \ -// RUN: -fsycl-instrument-device-code -ccc-print-phases %s -fno-sycl-device-lib=all 2>&1 \ +// RUN: -fsycl-instrument-device-code -ccc-print-phases %s --no-offloadlib 2>&1 \ // RUN: | FileCheck %s -check-prefix=JIT_AOT_PHASES // JIT_AOT_PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (device-sycl) // JIT_AOT_PHASES: 1: preprocessor, {0}, c++-cpp-output, (device-sycl) diff --git a/clang/test/Driver/sycl-force-target.cpp b/clang/test/Driver/sycl-force-target.cpp index 4a2b2e4a843d0..f608fffbb5471 100644 --- a/clang/test/Driver/sycl-force-target.cpp +++ b/clang/test/Driver/sycl-force-target.cpp @@ -25,7 +25,7 @@ /// Verify the usage of -fsycl-force-target applies to all expected unbundlings /// and also applies to clang-offload-deps step // RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -fsycl-force-target=spir64 \ -// RUN: -target x86_64-unknown-linux-gnu -fno-sycl-device-lib=all \ +// RUN: -target x86_64-unknown-linux-gnu --no-offloadlib \ // RUN: %s %S/Inputs/SYCL/liblin64.a -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK_FORCE_TARGET_ARCHIVE // CHECK_FORCE_TARGET_ARCHIVE: clang-offload-deps{{.*}} "-targets=sycl-spir64-unknown-unknown" "-outputs={{.*}}" diff --git a/clang/test/Driver/sycl-instrumentation-old-model.c b/clang/test/Driver/sycl-instrumentation-old-model.c index e76e60e062f49..f2223a384112f 100644 --- a/clang/test/Driver/sycl-instrumentation-old-model.c +++ b/clang/test/Driver/sycl-instrumentation-old-model.c @@ -10,7 +10,7 @@ // RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-instrument-device-code --sysroot=%S/Inputs/SYCL -fsycl-targets=spir64 -### %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK-SPIRV,CHECK-HOST %s // -fno-sycl-device-lib mustn't affect the linkage of ITT libraries -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-instrument-device-code --sysroot=%S/Inputs/SYCL -fno-sycl-device-lib=all -fsycl-targets=spir64 -### %s 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-instrument-device-code --sysroot=%S/Inputs/SYCL --no-offloadlib -fsycl-targets=spir64 -### %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK-SPIRV %s // CHECK-SPIRV: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-instrument-device-code" diff --git a/clang/test/Driver/sycl-instrumentation.c b/clang/test/Driver/sycl-instrumentation.c index f974653f877cd..23cb5b9558b2a 100644 --- a/clang/test/Driver/sycl-instrumentation.c +++ b/clang/test/Driver/sycl-instrumentation.c @@ -10,7 +10,7 @@ // RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fsycl-instrument-device-code --offload-new-driver --sysroot=%S/Inputs/SYCL -fsycl-targets=spir64 -### %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK-SPIRV,CHECK-HOST %s // -fno-sycl-device-lib mustn't affect the linkage of ITT libraries -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fsycl-instrument-device-code --offload-new-driver --sysroot=%S/Inputs/SYCL -fno-sycl-device-lib=all -fsycl-targets=spir64 -### %s 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fsycl-instrument-device-code --offload-new-driver --sysroot=%S/Inputs/SYCL --no-offloadlib -fsycl-targets=spir64 -### %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK-SPIRV %s // CHECK-SPIRV: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-instrument-device-code" diff --git a/clang/test/Driver/sycl-int-footer-old-model.cpp b/clang/test/Driver/sycl-int-footer-old-model.cpp index f317d936bef9c..be7b28f98a546 100644 --- a/clang/test/Driver/sycl-int-footer-old-model.cpp +++ b/clang/test/Driver/sycl-int-footer-old-model.cpp @@ -34,7 +34,7 @@ // NO-FOOTER: clang{{.*}} "-fsycl-is-host"{{.*}} "-include-internal-header" "[[INTHEADER]]" /// Check phases without integration footer -// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fno-sycl-use-footer -target x86_64-unknown-linux-gnu %s -ccc-print-phases 2>&1 \ +// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fno-sycl-use-footer -target x86_64-unknown-linux-gnu %s -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefix NO-FOOTER-PHASES -check-prefix COMMON-PHASES %s // NO-FOOTER-PHASES: 0: input, "{{.*}}", c++, (host-sycl) // NO-FOOTER-PHASES: [[#HOST_PREPROC:]]: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -43,7 +43,7 @@ // NO-FOOTER-PHASES: [[#DEVICE_IR:]]: compiler, {3}, ir, (device-sycl) /// Check phases with integration footer -// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu %s -ccc-print-phases 2>&1 \ +// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -target x86_64-unknown-linux-gnu %s -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefix FOOTER-PHASES -check-prefix COMMON-PHASES %s // FOOTER-PHASES: 0: input, "{{.*}}", c++, (host-sycl) // FOOTER-PHASES: [[#HOST_PREPROC:]]: preprocessor, {0}, c++-cpp-output, (host-sycl) diff --git a/clang/test/Driver/sycl-int-header-footer.cpp b/clang/test/Driver/sycl-int-header-footer.cpp index d84c645236de0..c46c954ef1d4a 100644 --- a/clang/test/Driver/sycl-int-header-footer.cpp +++ b/clang/test/Driver/sycl-int-header-footer.cpp @@ -32,7 +32,7 @@ // NO-FOOTER: clang{{.*}} "-fsycl-is-host"{{.*}} "-include-internal-header" "[[INTHEADER]]" /// Check phases without integration footer -// RUN: %clangxx -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fno-sycl-use-footer -target x86_64-unknown-linux-gnu %s -ccc-print-phases 2>&1 \ +// RUN: %clangxx -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fno-sycl-use-footer -target x86_64-unknown-linux-gnu %s -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefix NO-FOOTER-PHASES -check-prefix COMMON-PHASES %s // NO-FOOTER-PHASES: 0: input, "{{.*}}", c++, (host-sycl) // NO-FOOTER-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -42,7 +42,7 @@ // NO-FOOTER-PHASES: [[#DEVICE_IR:]]: compiler, {4}, ir, (device-sycl) /// Check phases with integration footer -// RUN: %clangxx -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu %s -ccc-print-phases 2>&1 \ +// RUN: %clangxx -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -target x86_64-unknown-linux-gnu %s -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefix FOOTER-PHASES -check-prefix COMMON-PHASES %s // FOOTER-PHASES: 0: input, "{{.*}}", c++, (host-sycl) // FOOTER-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-amdgcn.cpp b/clang/test/Driver/sycl-offload-amdgcn.cpp index f118ade6e06c8..c29d8ebd2ef0d 100644 --- a/clang/test/Driver/sycl-offload-amdgcn.cpp +++ b/clang/test/Driver/sycl-offload-amdgcn.cpp @@ -25,7 +25,7 @@ /// Check phases w/out specifying a compute capability. // RUN: %clangxx -ccc-print-phases -std=c++11 -target x86_64-unknown-linux-gnu -fsycl \ -// RUN: -fsycl-targets=amdgcn-amd-amdhsa -fsycl-device-lib=all -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ +// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-NO-CC %s // CHK-PHASES-NO-CC: 0: input, "{{.*}}", c++, (host-sycl) // CHK-PHASES-NO-CC: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-aot.cpp b/clang/test/Driver/sycl-offload-aot.cpp index 3a0d07d5d24a0..b9d08350ad6a8 100644 --- a/clang/test/Driver/sycl-offload-aot.cpp +++ b/clang/test/Driver/sycl-offload-aot.cpp @@ -46,13 +46,13 @@ // CHK-FSYCL-TARGET-2X-ERROR-NOT: clang{{.*}} error: cannot deduce implicit triple value for '-Xsycl-target{{.*}}', specify triple using '-Xsycl-target{{.*}}=' /// Ahead of Time compilation for gen, cpu -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64_gen-unknown-unknown %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64_gen-unknown-unknown %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64_gen %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64_gen %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64-unknown-unknown %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64_x86_64-unknown-unknown %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-CPU -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64 %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64_x86_64 %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-CPU // CHK-PHASES-AOT: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl) // CHK-PHASES-AOT: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -79,13 +79,13 @@ /// ########################################################################### /// Ahead of Time compilation for gen, cpu - tool invocation -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-CPU -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-CPU // CHK-TOOLS-GEN: clang{{.*}} "-triple" "spir64_gen-unknown-unknown" // CHK-TOOLS-CPU: clang{{.*}} "-triple" "spir64_x86_64-unknown-unknown" @@ -179,7 +179,7 @@ /// ########################################################################### /// offload with multiple targets, including AOT -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown,spir64_x86_64-unknown-unknown,spir64_gen-unknown-unknown -ccc-print-phases %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64-unknown-unknown,spir64_x86_64-unknown-unknown,spir64_gen-unknown-unknown -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASE-MULTI-TARG %s // CHK-PHASE-MULTI-TARG: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl) // CHK-PHASE-MULTI-TARG: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-nvptx.cpp b/clang/test/Driver/sycl-offload-nvptx.cpp index a1a5504eb67f1..c20273fed071b 100644 --- a/clang/test/Driver/sycl-offload-nvptx.cpp +++ b/clang/test/Driver/sycl-offload-nvptx.cpp @@ -36,7 +36,7 @@ /// Check phases w/out specifying a compute capability. // RUN: %clangxx -ccc-print-phases --sysroot=%S/Inputs/SYCL -std=c++11 \ -// RUN: -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all \ +// RUN: -target x86_64-unknown-linux-gnu -fsycl --no-offloadlib \ // RUN: -fsycl-targets=nvptx64-nvidia-cuda %s 2>&1 \ // RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/share/clc/remangled-l32-signed_char.libspirv-nvptx64-nvidia-cuda.bc \ // RUN: --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \ @@ -55,22 +55,21 @@ // CHK-PHASES-NO-CC: 8: assembler, {7}, object, (host-sycl) // CHK-PHASES-NO-CC: 9: linker, {4}, ir, (device-sycl, sm_50) // CHK-PHASES-NO-CC: 10: input, "{{.*}}libspirv-nvptx64{{.*}}", ir, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 11: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 12: linker, {9, 10, 11}, ir, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 13: sycl-post-link, {12}, ir, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 14: file-table-tform, {13}, ir, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 15: backend, {14}, assembler, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 16: assembler, {15}, object, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 17: linker, {15, 16}, cuda-fatbin, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 18: foreach, {14, 17}, cuda-fatbin, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 19: file-table-tform, {13, 18}, tempfiletable, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 20: clang-offload-wrapper, {19}, object, (device-sycl, sm_50) -// CHK-PHASES-NO-CC: 21: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {20}, object -// CHK-PHASES-NO-CC: 22: linker, {8, 21}, image, (host-sycl) +// CHK-PHASES-NO-CC: 11: linker, {9, 10}, ir, (device-sycl, sm_50) +// CHK-PHASES-NO-CC: 12: sycl-post-link, {11}, ir, (device-sycl, sm_50) +// CHK-PHASES-NO-CC: 13: file-table-tform, {12}, ir, (device-sycl, sm_50) +// CHK-PHASES-NO-CC: 14: backend, {13}, assembler, (device-sycl, sm_50) +// CHK-PHASES-NO-CC: 15: assembler, {14}, object, (device-sycl, sm_50) +// CHK-PHASES-NO-CC: 16: linker, {14, 15}, cuda-fatbin, (device-sycl, sm_50) +// CHK-PHASES-NO-CC: 17: foreach, {13, 16}, cuda-fatbin, (device-sycl, sm_50) +// CHK-PHASES-NO-CC: 18: file-table-tform, {12, 17}, tempfiletable, (device-sycl, sm_50) +// CHK-PHASES-NO-CC: 19: clang-offload-wrapper, {18}, object, (device-sycl, sm_50) +// CHK-PHASES-NO-CC: 20: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {19}, object +// CHK-PHASES-NO-CC: 21: linker, {8, 20}, image, (host-sycl) // /// Check phases specifying a compute capability. // RUN: %clangxx -ccc-print-phases --sysroot=%S/Inputs/SYCL -std=c++11 \ -// RUN: -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all \ +// RUN: -target x86_64-unknown-linux-gnu -fsycl --no-offloadlib \ // RUN: -fsycl-targets=nvptx64-nvidia-cuda \ // RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/share/clc/remangled-l32-signed_char.libspirv-nvptx64-nvidia-cuda.bc \ // RUN: --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \ @@ -90,18 +89,17 @@ // CHK-PHASES: 8: assembler, {7}, object, (host-sycl) // CHK-PHASES: 9: linker, {4}, ir, (device-sycl, sm_35) // CHK-PHASES: 10: input, "{{.*}}libspirv-nvptx64{{.*}}", ir, (device-sycl, sm_35) -// CHK-PHASES: 11: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_35) -// CHK-PHASES: 12: linker, {9, 10, 11}, ir, (device-sycl, sm_35) -// CHK-PHASES: 13: sycl-post-link, {12}, ir, (device-sycl, sm_35) -// CHK-PHASES: 14: file-table-tform, {13}, ir, (device-sycl, sm_35) -// CHK-PHASES: 15: backend, {14}, assembler, (device-sycl, sm_35) -// CHK-PHASES: 16: assembler, {15}, object, (device-sycl, sm_35) -// CHK-PHASES: 17: linker, {15, 16}, cuda-fatbin, (device-sycl, sm_35) -// CHK-PHASES: 18: foreach, {14, 17}, cuda-fatbin, (device-sycl, sm_35) -// CHK-PHASES: 19: file-table-tform, {13, 18}, tempfiletable, (device-sycl, sm_35) -// CHK-PHASES: 20: clang-offload-wrapper, {19}, object, (device-sycl, sm_35) -// CHK-PHASES: 21: offload, "device-sycl (nvptx64-nvidia-cuda:sm_35)" {20}, object -// CHK-PHASES: 22: linker, {8, 21}, image, (host-sycl) +// CHK-PHASES: 11: linker, {9, 10}, ir, (device-sycl, sm_35) +// CHK-PHASES: 12: sycl-post-link, {11}, ir, (device-sycl, sm_35) +// CHK-PHASES: 13: file-table-tform, {12}, ir, (device-sycl, sm_35) +// CHK-PHASES: 14: backend, {13}, assembler, (device-sycl, sm_35) +// CHK-PHASES: 15: assembler, {14}, object, (device-sycl, sm_35) +// CHK-PHASES: 16: linker, {14, 15}, cuda-fatbin, (device-sycl, sm_35) +// CHK-PHASES: 17: foreach, {13, 16}, cuda-fatbin, (device-sycl, sm_35) +// CHK-PHASES: 18: file-table-tform, {12, 17}, tempfiletable, (device-sycl, sm_35) +// CHK-PHASES: 19: clang-offload-wrapper, {18}, object, (device-sycl, sm_35) +// CHK-PHASES: 20: offload, "device-sycl (nvptx64-nvidia-cuda:sm_35)" {19}, object +// CHK-PHASES: 21: linker, {8, 20}, image, (host-sycl) /// Check calling preprocessor only // RUN: %clangxx -E -fsycl -fsycl-targets=nvptx64-nvidia-cuda -ccc-print-phases %s 2>&1 \ diff --git a/clang/test/Driver/sycl-offload-old-model.c b/clang/test/Driver/sycl-offload-old-model.c index 09658fe35242c..c19e909452ddf 100644 --- a/clang/test/Driver/sycl-offload-old-model.c +++ b/clang/test/Driver/sycl-offload-old-model.c @@ -123,17 +123,17 @@ /// preprocessor and another one joining the device linking outputs to the host /// action. The same graph should be generated when no -fsycl-targets is used /// The same phase graph will be used with -fsycl-device-obj=llvmir -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES %s -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-device-obj=spirv -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-device-obj=spirv -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fsycl-device-obj=spirv -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fsycl-device-obj=spirv -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES %s -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-device-obj=llvmir -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-device-obj=llvmir -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fsycl-device-obj=llvmir -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fsycl-device-obj=llvmir -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES %s // CHK-PHASES: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -161,9 +161,9 @@ /// preprocessor and another one joining the device linking outputs to the host /// action. The same graph should be generated when no -fsycl-targets is used /// The same phase graph will be used with -fsycl-device-obj=llvmir -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-targets=spirv64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-targets=spirv64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES-2,CHK-PHASES-DEFAULT-MODE-2 %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fsycl-targets=spirv64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fsycl-targets=spirv64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES-2,CHK-PHASES-CL-MODE-2 %s // CHK-PHASES-2: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES-2: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -197,7 +197,7 @@ /// Check the phases also add a library to make sure it is treated as input by /// the device. -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-LIB %s // CHK-PHASES-LIB: 0: input, "somelib", object, (host-sycl) // CHK-PHASES-LIB: 1: input, "[[INPUT:.+\.c]]", c++, (host-sycl) @@ -229,7 +229,7 @@ /// Check the phases when using and multiple source files // RUN: echo " " > %t.c -// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s %t.c 2>&1 \ +// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s %t.c 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-FILES %s // CHK-PHASES-FILES: 0: input, "somelib", object, (host-sycl) // CHK-PHASES-FILES: 1: input, "[[INPUT1:.+\.c]]", c++, (host-sycl) @@ -280,13 +280,13 @@ /// Check separate compilation with offloading - unbundling actions // RUN: touch %t.o -// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -o %t.out -lsomelib -fsycl-targets=spir64-unknown-unknown %t.o 2>&1 \ +// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -o %t.out -lsomelib -fsycl-targets=spir64-unknown-unknown %t.o 2>&1 \ // RUN: | FileCheck -DINPUT=%t.o -check-prefix=CHK-UBACTIONS %s -// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -o %t.out -lsomelib -fsycl-targets=spir64 %t.o 2>&1 \ +// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -o %t.out -lsomelib -fsycl-targets=spir64 %t.o 2>&1 \ // RUN: | FileCheck -DINPUT=%t.o -check-prefix=CHK-UBACTIONS %s // RUN: mkdir -p %t_dir // RUN: touch %t_dir/dummy -// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -o %t.out -lsomelib -fsycl-targets=spir64-unknown-unknown %t_dir/dummy 2>&1 \ +// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -o %t.out -lsomelib -fsycl-targets=spir64-unknown-unknown %t_dir/dummy 2>&1 \ // RUN: | FileCheck -DINPUT=%t_dir/dummy -check-prefix=CHK-UBACTIONS %s // CHK-UBACTIONS: 0: input, "somelib", object, (host-sycl) // CHK-UBACTIONS: 1: input, "[[INPUT]]", object, (host-sycl) @@ -305,7 +305,7 @@ /// Check separate compilation with offloading - unbundling with source // RUN: touch %t.o -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t.o -fsycl-targets=spir64-unknown-unknown %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t.o -fsycl-targets=spir64-unknown-unknown %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-UBUACTIONS %s // CHK-UBUACTIONS: 0: input, "somelib", object, (host-sycl) // CHK-UBUACTIONS: 1: input, "[[INPUT1:.+\.o]]", object, (host-sycl) @@ -355,9 +355,9 @@ /// Check -fsycl-link behaviors unbundle // RUN: touch %t.o -// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t.o 2>&1 \ +// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code --no-offloadlib %t.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-LINK-UB %s -// RUN: %clang_cl -### -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t.o 2>&1 \ +// RUN: %clang_cl -### -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code --no-offloadlib %t.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-LINK-UB %s // CHK-LINK-UB: 0: input, "[[INPUT:.+\.o]]", object // CHK-LINK-UB: 1: clang-offload-unbundler, {0}, object @@ -375,11 +375,11 @@ /// Check -fsycl-link tool calls // RUN: %clangxx -### --target=x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -o %t.out \ // RUN: -fsycl-targets=spir64_gen -fsycl-link \ -// RUN: -fno-sycl-device-lib=all %t.o 2>&1 \ +// RUN: --no-offloadlib %t.o 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-FSYCL-LINK-UB,CHK-FSYCL-LINK-UB-LIN %s // RUN: %clang_cl -### --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -o %t.out \ // RUN: -fsycl-targets=spir64_gen -fsycl-link \ -// RUN: -fno-sycl-device-lib=all %t.o 2>&1 \ +// RUN: --no-offloadlib %t.o 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-FSYCL-LINK-UB,CHK-FSYCL-LINK-UB-WIN %s // CHK-FSYCL-LINK-UB: clang-offload-bundler{{.*}} "-type=o" "-targets=host{{.*}},sycl-spir64_gen-unknown-unknown" "-input=[[INPUT:.+\.o]]" "-output={{.*}}" "-output=[[DEVICE_O:.+]]" "-unbundle" // CHK-FSYCL-LINK-UB: spirv-to-ir-wrapper{{.*}} "[[DEVICE_O]]" "-o" "[[DEVICE_BC:.+\.bc]]" @@ -396,11 +396,11 @@ /// Check -fsycl-link AOT unbundle // RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu \ // RUN: -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code \ -// RUN: -fsycl-targets=spir64_gen -fno-sycl-device-lib=all %t.o 2>&1 \ +// RUN: -fsycl-targets=spir64_gen --no-offloadlib %t.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-LINK-AOT-UB %s // RUN: %clang_cl -### -ccc-print-phases --target=x86_64-pc-windows-msvc \ // RUN: -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code \ -// RUN: -fsycl-targets=spir64_gen -fno-sycl-device-lib=all %t.o 2>&1 \ +// RUN: -fsycl-targets=spir64_gen --no-offloadlib %t.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-LINK-AOT-UB %s // CHK-LINK-AOT-UB: 0: input, "[[INPUT:.+\.o]]", object // CHK-LINK-AOT-UB: 1: clang-offload-unbundler, {0}, object @@ -420,12 +420,12 @@ // RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu \ // RUN: -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code \ // RUN: -fsycl-targets=spir64_gen,spir64 \ -// RUN: -fno-sycl-device-lib=all %t.o 2>&1 \ +// RUN: --no-offloadlib %t.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-LINK-AOT-JIT-UB %s // RUN: %clang_cl -### -ccc-print-phases --target=x86_64-pc-windows-msvc \ // RUN: -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code \ // RUN: -fsycl-targets=spir64_gen,spir64 \ -// RUN: -fno-sycl-device-lib=all %t.o 2>&1 \ +// RUN: --no-offloadlib %t.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-LINK-AOT-JIT-UB %s // CHK-LINK-AOT-JIT-UB: 0: input, "[[INPUT:.+\.o]]", object // CHK-LINK-AOT-JIT-UB: 1: clang-offload-unbundler, {0}, object @@ -451,9 +451,9 @@ /// ########################################################################### /// Check -fsycl-link behaviors from source -// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-LINK %s -// RUN: %clang_cl -### -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -### -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -o %t.out -fsycl-link -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-LINK %s // CHK-LINK: 0: input, "[[INPUT:.+\.c]]", c++, (device-sycl) // CHK-LINK: 1: preprocessor, {0}, c++-cpp-output, (device-sycl) @@ -603,7 +603,7 @@ /// ########################################################################### /// Verify that triple-boundarch pairs are correct with multi-targetting -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib \ // RUN: -fsycl-targets=nvptx64-nvidia-cuda,spir64 -ccc-print-phases --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \ // RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/share/clc/remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASE-MULTI-TARG-BOUND-ARCH %s @@ -621,28 +621,27 @@ // CHK-PHASE-MULTI-TARG-BOUND-ARCH: 11: compiler, {10}, ir, (device-sycl, sm_50) // CHK-PHASE-MULTI-TARG-BOUND-ARCH: 12: linker, {11}, ir, (device-sycl, sm_50) // CHK-PHASE-MULTI-TARG-BOUND-ARCH: 13: input, "{{.*}}libspirv-nvptx64{{.*}}", ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 14: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 15: linker, {12, 13, 14}, ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 16: sycl-post-link, {15}, ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 17: file-table-tform, {16}, ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 18: backend, {17}, assembler, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 19: assembler, {18}, object, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 20: linker, {18, 19}, cuda-fatbin, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 21: foreach, {17, 20}, cuda-fatbin, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 22: file-table-tform, {16, 21}, tempfiletable, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 23: clang-offload-wrapper, {22}, object, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 24: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {23}, object -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 25: linker, {4}, ir, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 26: sycl-post-link, {25}, tempfiletable, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 27: file-table-tform, {26}, tempfilelist, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 28: llvm-spirv, {27}, tempfilelist, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 29: file-table-tform, {26, 28}, tempfiletable, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 30: clang-offload-wrapper, {29}, object, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 31: offload, "device-sycl (spir64-unknown-unknown)" {30}, object -// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 32: linker, {8, 24, 31}, image, (host-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 14: linker, {12, 13}, ir, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 15: sycl-post-link, {14}, ir, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 16: file-table-tform, {15}, ir, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 17: backend, {16}, assembler, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 18: assembler, {17}, object, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 19: linker, {17, 18}, cuda-fatbin, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 20: foreach, {16, 19}, cuda-fatbin, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 21: file-table-tform, {15, 20}, tempfiletable, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 22: clang-offload-wrapper, {21}, object, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 23: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {22}, object +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 24: linker, {4}, ir, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 25: sycl-post-link, {24}, tempfiletable, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 26: file-table-tform, {25}, tempfilelist, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 27: llvm-spirv, {26}, tempfilelist, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 28: file-table-tform, {25, 27}, tempfiletable, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 29: clang-offload-wrapper, {28}, object, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 30: offload, "device-sycl (spir64-unknown-unknown)" {29}, object +// CHK-PHASE-MULTI-TARG-BOUND-ARCH: 31: linker, {8, 23, 30}, image, (host-sycl) // RUN: %clang -target x86_64-unknown-linux-gnu -fsycl \ -// RUN: -fno-sycl-instrument-device-code -fno-sycl-device-lib=all \ +// RUN: -fno-sycl-instrument-device-code --no-offloadlib \ // RUN: -fsycl-targets=nvptx64-nvidia-cuda,spir64_gen \ // RUN: --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \ // RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/share/clc/remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc \ @@ -663,30 +662,29 @@ // CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 11: compiler, {10}, ir, (device-sycl, sm_50) // CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 12: linker, {11}, ir, (device-sycl, sm_50) // CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 13: input, "{{.*}}libspirv-nvptx64{{.*}}", ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 14: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 15: linker, {12, 13, 14}, ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 16: sycl-post-link, {15}, ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 17: file-table-tform, {16}, ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 18: backend, {17}, assembler, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 19: assembler, {18}, object, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 20: linker, {18, 19}, cuda-fatbin, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 21: foreach, {17, 20}, cuda-fatbin, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 22: file-table-tform, {16, 21}, tempfiletable, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 23: clang-offload-wrapper, {22}, object, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 24: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {23}, object -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 25: linker, {4}, ir, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 26: sycl-post-link, {25}, tempfiletable, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 27: file-table-tform, {26}, tempfilelist, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 28: llvm-spirv, {27}, tempfilelist, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 29: backend-compiler, {28}, image, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 30: file-table-tform, {26, 29}, tempfiletable, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 31: clang-offload-wrapper, {30}, object, (device-sycl) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 32: offload, "device-sycl (spir64_gen-unknown-unknown)" {31}, object -// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 33: linker, {8, 24, 32}, image, (host-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 14: linker, {12, 13}, ir, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 15: sycl-post-link, {14}, ir, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 16: file-table-tform, {15}, ir, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 17: backend, {16}, assembler, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 18: assembler, {17}, object, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 19: linker, {17, 18}, cuda-fatbin, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 20: foreach, {16, 19}, cuda-fatbin, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 21: file-table-tform, {15, 20}, tempfiletable, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 22: clang-offload-wrapper, {21}, object, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 23: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {22}, object +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 24: linker, {4}, ir, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 25: sycl-post-link, {24}, tempfiletable, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 26: file-table-tform, {25}, tempfilelist, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 27: llvm-spirv, {26}, tempfilelist, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 28: backend-compiler, {27}, image, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 29: file-table-tform, {25, 28}, tempfiletable, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 30: clang-offload-wrapper, {29}, object, (device-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 31: offload, "device-sycl (spir64_gen-unknown-unknown)" {30}, object +// CHK-PHASE-MULTI-TARG-BOUND-ARCH2: 32: linker, {8, 23, 31}, image, (host-sycl) /// Check the behaviour however with swapped -fsycl-targets // RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver \ -// RUN: -fno-sycl-instrument-device-code -fno-sycl-device-lib=all \ +// RUN: -fno-sycl-instrument-device-code --no-offloadlib \ // RUN: --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \ // RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/share/clc/remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc \ // RUN: -fsycl-targets=spir64,nvptx64-nvidia-cuda -ccc-print-phases %s 2>&1 \ @@ -712,24 +710,23 @@ // CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 18: offload, "device-sycl (spir64-unknown-unknown)" {17}, object // CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 19: linker, {4}, ir, (device-sycl, sm_50) // CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 20: input, "{{.*}}libspirv-nvptx64{{.*}}", ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 21: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 22: linker, {19, 20, 21}, ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 23: sycl-post-link, {22}, ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 24: file-table-tform, {23}, ir, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 25: backend, {24}, assembler, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 26: assembler, {25}, object, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 27: linker, {25, 26}, cuda-fatbin, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 28: foreach, {24, 27}, cuda-fatbin, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 29: file-table-tform, {23, 28}, tempfiletable, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 30: clang-offload-wrapper, {29}, object, (device-sycl, sm_50) -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 31: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {30}, object -// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 32: linker, {8, 18, 31}, image, (host-sycl) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 21: linker, {19, 20}, ir, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 22: sycl-post-link, {21}, ir, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 23: file-table-tform, {22}, ir, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 24: backend, {23}, assembler, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 25: assembler, {24}, object, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 26: linker, {24, 25}, cuda-fatbin, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 27: foreach, {23, 26}, cuda-fatbin, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 28: file-table-tform, {22, 27}, tempfiletable, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 29: clang-offload-wrapper, {28}, object, (device-sycl, sm_50) +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 30: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {29}, object +// CHK-PHASE-MULTI-TARG-BOUND-ARCH-FLIPPED: 31: linker, {8, 18, 30}, image, (host-sycl) /// ########################################################################### // Check if valid bound arch behaviour occurs when compiling for spir-v,nvidia-gpu, and amd-gpu // RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver \ -// RUN: -fno-sycl-instrument-device-code -fno-sycl-device-lib=all \ +// RUN: -fno-sycl-instrument-device-code --no-offloadlib \ // RUN: --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \ // RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/share/clc/remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc \ // RUN: -fsycl-targets=spir64,nvptx64-nvidia-cuda,amdgcn-amd-amdhsa \ @@ -760,29 +757,28 @@ // CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 21: compiler, {20}, ir, (device-sycl, sm_75) // CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 22: linker, {21}, ir, (device-sycl, sm_75) // CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 23: input, "{{.*}}libspirv-nvptx64{{.*}}", ir, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 24: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 25: linker, {22, 23, 24}, ir, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 26: sycl-post-link, {25}, ir, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 27: file-table-tform, {26}, ir, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 28: backend, {27}, assembler, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 29: assembler, {28}, object, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 30: linker, {28, 29}, cuda-fatbin, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 31: foreach, {27, 30}, cuda-fatbin, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 32: file-table-tform, {26, 31}, tempfiletable, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 33: clang-offload-wrapper, {32}, object, (device-sycl, sm_75) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 34: offload, "device-sycl (nvptx64-nvidia-cuda:sm_75)" {33}, object -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 35: linker, {4}, ir, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 36: sycl-post-link, {35}, ir, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 37: file-table-tform, {36}, ir, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 38: backend, {37}, assembler, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 39: assembler, {38}, object, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 40: linker, {39}, image, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 41: linker, {40}, hip-fatbin, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 42: foreach, {37, 41}, hip-fatbin, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 43: file-table-tform, {36, 42}, tempfiletable, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 44: clang-offload-wrapper, {43}, object, (device-sycl, gfx908) -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 45: offload, "device-sycl (amdgcn-amd-amdhsa:gfx908)" {44}, object -// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 46: linker, {8, 18, 34, 45}, image, (host-sycl) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 24: linker, {22, 23}, ir, (device-sycl, sm_75) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 25: sycl-post-link, {24}, ir, (device-sycl, sm_75) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 26: file-table-tform, {25}, ir, (device-sycl, sm_75) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 27: backend, {26}, assembler, (device-sycl, sm_75) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 28: assembler, {27}, object, (device-sycl, sm_75) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 29: linker, {27, 28}, cuda-fatbin, (device-sycl, sm_75) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 30: foreach, {26, 29}, cuda-fatbin, (device-sycl, sm_75) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 31: file-table-tform, {25, 30}, tempfiletable, (device-sycl, sm_75) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 32: clang-offload-wrapper, {31}, object, (device-sycl, sm_75) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 33: offload, "device-sycl (nvptx64-nvidia-cuda:sm_75)" {32}, object +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 34: linker, {4}, ir, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 35: sycl-post-link, {34}, ir, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 36: file-table-tform, {35}, ir, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 37: backend, {36}, assembler, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 38: assembler, {37}, object, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 39: linker, {38}, image, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 40: linker, {39}, hip-fatbin, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 41: foreach, {36, 40}, hip-fatbin, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 42: file-table-tform, {35, 41}, tempfiletable, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 43: clang-offload-wrapper, {42}, object, (device-sycl, gfx908) +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 44: offload, "device-sycl (amdgcn-amd-amdhsa:gfx908)" {43}, object +// CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 45: linker, {8, 18, 33, 44}, image, (host-sycl) /// -fsycl --no-offload-new-driver with /Fo testing // RUN: %clang_cl -fsycl --no-offload-new-driver /Fosomefile.obj -c %s -### 2>&1 \ @@ -794,9 +790,9 @@ /// passing of a library should not trigger the unbundler // RUN: touch %t.a // RUN: touch %t.lib -// RUN: %clang -ccc-print-phases -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t.a %s 2>&1 \ +// RUN: %clang -ccc-print-phases -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t.a %s 2>&1 \ // RUN: | FileCheck -check-prefix=LIB-UNBUNDLE-CHECK %s -// RUN: %clang_cl -ccc-print-phases -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t.lib %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t.lib %s 2>&1 \ // RUN: | FileCheck -check-prefix=LIB-UNBUNDLE-CHECK %s // LIB-UNBUNDLE-CHECK-NOT: clang-offload-unbundler diff --git a/clang/test/Driver/sycl-offload-save-temps-old-model.cpp b/clang/test/Driver/sycl-offload-save-temps-old-model.cpp index eba3d6cbe4814..b55260a2ac9bd 100644 --- a/clang/test/Driver/sycl-offload-save-temps-old-model.cpp +++ b/clang/test/Driver/sycl-offload-save-temps-old-model.cpp @@ -1,11 +1,11 @@ /// SYCL offloading tests using -save-temps /// Verify that -save-temps does not crash -// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ +// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-SAVE-TEMPS,CHK-FSYCL-SAVE-TEMPS-CONFL -// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ +// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-SAVE-TEMPS,CHK-FSYCL-SAVE-TEMPS-CONFL -// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ +// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-SAVE-TEMPS,CHK-FSYCL-SAVE-TEMPS-CONFL // CHK-FSYCL-SAVE-TEMPS: clang{{.*}} "-fsycl-is-device"{{.*}} "-o" "[[DEVICE_BASE_NAME:[a-z0-9-]+]].ii" // CHK-FSYCL-SAVE-TEMPS: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[HEADER_NAME:.+\-header.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[DEVICE_BASE_NAME]].bc"{{.*}} "[[DEVICE_BASE_NAME]].ii" @@ -26,11 +26,11 @@ // CHK-FSYCL-SAVE-TEMPS: ld{{.*}} "[[HOST_BASE_NAME]].o"{{.*}} "[[DEVICE_OBJ_NAME]]" /// Verify that -save-temps puts header/footer in a correct place -// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 | FileCheck %s -check-prefixes=CHECK-SAVE-TEMPS-DIR +// RUN: %clang -fsycl --no-offload-new-driver --no-offloadlib -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 | FileCheck %s -check-prefixes=CHECK-SAVE-TEMPS-DIR // CHECK-SAVE-TEMPS-DIR: clang{{.*}} "-fsycl-int-header=sycl-offload-save-temps-old-model-header-{{[a-z0-9]*}}.h"{{.*}}"-fsycl-int-footer=sycl-offload-save-temps-old-model-footer-{{[a-z0-9]*}}.h" /// Verify that -save-temps=obj respects the -o dir -// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps=obj -o %S %s -### 2>&1 | FileCheck %s -check-prefixes=CHECK-SAVE-TEMPS-OBJ-DIR +// RUN: %clang -fsycl --no-offload-new-driver --no-offloadlib -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps=obj -o %S %s -### 2>&1 | FileCheck %s -check-prefixes=CHECK-SAVE-TEMPS-OBJ-DIR // CHECK-SAVE-TEMPS-OBJ-DIR: clang{{.*}}-fsycl-int-header={{.*[/\\]+clang[/\\]+test[/\\]+sycl-offload-save-temps-old-model-header-[a-z0-9]*}}.h{{.*}}-fsycl-int-footer={{.*[/\\]+clang[/\\]+test[/\\]+sycl-offload-save-temps-old-model-footer-[a-z0-9]*}}.h /// Usage of -save-temps should not set -disable-llvm-passes for device diff --git a/clang/test/Driver/sycl-offload-save-temps.cpp b/clang/test/Driver/sycl-offload-save-temps.cpp index 034b43ffe54ef..19ab19f75d7a1 100644 --- a/clang/test/Driver/sycl-offload-save-temps.cpp +++ b/clang/test/Driver/sycl-offload-save-temps.cpp @@ -1,11 +1,11 @@ /// SYCL offloading tests using -save-temps /// Verify that -save-temps does not crash -// RUN: %clang -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ +// RUN: %clang -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-SAVE-TEMPS -// RUN: %clang -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ +// RUN: %clang -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-SAVE-TEMPS -// RUN: %clangxx -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ +// RUN: %clangxx -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-SAVE-TEMPS // CHK-FSYCL-SAVE-TEMPS: clang{{.*}} "-fsycl-is-device"{{.*}} "-o" "[[DEVICE_BASE_NAME:[a-z0-9-]+]].ii" // CHK-FSYCL-SAVE-TEMPS: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[HEADER_NAME:.+\-header.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[DEVICE_BASE_NAME]].bc"{{.*}} "[[DEVICE_BASE_NAME]].ii" @@ -17,11 +17,11 @@ // CHK-FSYCL-SAVE-TEMPS: ld{{.*}} "[[HOST_BASE_NAME]].o" /// Verify that -save-temps puts header/footer in a correct place -// RUN: %clang -fsycl --offload-new-driver -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 | FileCheck %s -check-prefixes=CHECK-SAVE-TEMPS-DIR +// RUN: %clang -fsycl --offload-new-driver --no-offloadlib -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 | FileCheck %s -check-prefixes=CHECK-SAVE-TEMPS-DIR // CHECK-SAVE-TEMPS-DIR: clang{{.*}} "-fsycl-int-header=sycl-offload-save-temps-header-{{[a-z0-9]*}}.h"{{.*}}"-fsycl-int-footer=sycl-offload-save-temps-footer-{{[a-z0-9]*}}.h" /// Verify that -save-temps=obj respects the -o dir -// RUN: %clang -fsycl --offload-new-driver -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps=obj -o %S %s -### 2>&1 | FileCheck %s -check-prefixes=CHECK-SAVE-TEMPS-OBJ-DIR +// RUN: %clang -fsycl --offload-new-driver --no-offloadlib -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -save-temps=obj -o %S %s -### 2>&1 | FileCheck %s -check-prefixes=CHECK-SAVE-TEMPS-OBJ-DIR // CHECK-SAVE-TEMPS-OBJ-DIR: clang{{.*}}-fsycl-int-header={{.*[/\\]+clang[/\\]+test[/\\]+sycl-offload-save-temps-header-[a-z0-9]*}}.h{{.*}}-fsycl-int-footer={{.*[/\\]+clang[/\\]+test[/\\]+sycl-offload-save-temps-footer-[a-z0-9]*}}.h /// Usage of -save-temps should not set -disable-llvm-passes for device diff --git a/clang/test/Driver/sycl-offload-static-lib-2-old-model.cpp b/clang/test/Driver/sycl-offload-static-lib-2-old-model.cpp index 3bff093cf79e3..3ba847a3872a5 100644 --- a/clang/test/Driver/sycl-offload-static-lib-2-old-model.cpp +++ b/clang/test/Driver/sycl-offload-static-lib-2-old-model.cpp @@ -89,9 +89,9 @@ // RUN: %clangxx -target x86_64-unknown-linux-gnu -fno-sycl-instrument-device-code \ // RUN: --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \ // RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/share/clc/remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc \ -// RUN: -fno-sycl-device-lib=all -fsycl --no-offload-new-driver %t_lib.a -ccc-print-phases %s 2>&1 \ +// RUN: --no-offloadlib -fsycl --no-offload-new-driver %t_lib.a -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=STATIC_LIB_SRC -DBUNDLE_TRIPLE=sycl-spir64-unknown-unknown -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fno-sycl-instrument-device-code -fno-sycl-device-lib=all \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fno-sycl-instrument-device-code --no-offloadlib \ // RUN: --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \ // RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/share/clc/remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc \ // RUN: -fsycl-targets=nvptx64-nvidia-cuda -fsycl --no-offload-new-driver %t_lib.a -ccc-print-phases %s 2>&1 \ @@ -136,18 +136,17 @@ // STATIC_LIB_SRC-CUDA: 13: clang-offload-unbundler, {12}, archive // STATIC_LIB_SRC-CUDA: 14: linker, {5, 11, 13}, ir, (device-sycl, sm_50) // STATIC_LIB_SRC-CUDA: 15: input, "{{.*}}libspirv-nvptx64{{.*}}", ir, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 16: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 17: linker, {14, 15, 16}, ir, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 18: sycl-post-link, {17}, ir, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 19: file-table-tform, {18}, ir, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 20: backend, {19}, assembler, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 21: assembler, {20}, object, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 22: linker, {20, 21}, cuda-fatbin, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 23: foreach, {19, 22}, cuda-fatbin, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 24: file-table-tform, {18, 23}, tempfiletable, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 25: clang-offload-wrapper, {24}, object, (device-sycl, sm_50) -// STATIC_LIB_SRC-CUDA: 26: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {25}, object -// STATIC_LIB_SRC-CUDA: 27: linker, {0, 9, 26}, image, (host-sycl) +// STATIC_LIB_SRC-CUDA: 16: linker, {14, 15}, ir, (device-sycl, sm_50) +// STATIC_LIB_SRC-CUDA: 17: sycl-post-link, {16}, ir, (device-sycl, sm_50) +// STATIC_LIB_SRC-CUDA: 18: file-table-tform, {17}, ir, (device-sycl, sm_50) +// STATIC_LIB_SRC-CUDA: 19: backend, {18}, assembler, (device-sycl, sm_50) +// STATIC_LIB_SRC-CUDA: 20: assembler, {19}, object, (device-sycl, sm_50) +// STATIC_LIB_SRC-CUDA: 21: linker, {19, 20}, cuda-fatbin, (device-sycl, sm_50) +// STATIC_LIB_SRC-CUDA: 22: foreach, {18, 21}, cuda-fatbin, (device-sycl, sm_50) +// STATIC_LIB_SRC-CUDA: 23: file-table-tform, {17, 22}, tempfiletable, (device-sycl, sm_50) +// STATIC_LIB_SRC-CUDA: 24: clang-offload-wrapper, {23}, object, (device-sycl, sm_50) +// STATIC_LIB_SRC-CUDA: 25: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {24}, object +// STATIC_LIB_SRC-CUDA: 26: linker, {0, 9, 25}, image, (host-sycl) /// ########################################################################### @@ -227,13 +226,13 @@ /// ########################################################################### /// test behaviors of static lib with no source/object -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -L/dummy/dir %t_lib.a -### 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -L/dummy/dir %t_lib.a -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=STATIC_LIB_NOSRC -check-prefix=STATIC_LIB_NOSRC-SPIR -DTARGET=spir64 -DBUNDLE_TRIPLE=sycl-spir64-unknown-unknown -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -L/dummy/dir %t_lib.lo -### 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -L/dummy/dir %t_lib.lo -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=STATIC_LIB_NOSRC -check-prefix=STATIC_LIB_NOSRC-SPIR -DTARGET=spir64 -DBUNDLE_TRIPLE=sycl-spir64-unknown-unknown -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-libspirv -nocudalib -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -L/dummy/dir %t_lib.a -### 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-libspirv -nocudalib -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-instrument-device-code --no-offloadlib -L/dummy/dir %t_lib.a -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=STATIC_LIB_NOSRC -check-prefix=STATIC_LIB_NOSRC-CUDA -DTARGET=nvptx64 -DBUNDLE_TRIPLE=sycl-nvptx64-nvidia-cuda-sm_50 -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-libspirv -nocudalib -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -L/dummy/dir %t_lib.lo -### 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-libspirv -nocudalib -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-instrument-device-code --no-offloadlib -L/dummy/dir %t_lib.lo -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=STATIC_LIB_NOSRC -check-prefix=STATIC_LIB_NOSRC-CUDA -DTARGET=nvptx64 -DBUNDLE_TRIPLE=sycl-nvptx64-nvidia-cuda-sm_50 // STATIC_LIB_NOSRC-SPIR: clang-offload-bundler{{.*}} "-type=aoo" "-targets=[[BUNDLE_TRIPLE]]" "-input={{.*}}_lib.{{(a|lo)}}" "-output=[[DEVICELIB:.+\.txt]]" "-unbundle" // STATIC_LIB_NOSRC-SPIR: llvm-foreach{{.*}}spirv-to-ir-wrapper{{.*}} "[[DEVICELIB]]" "-o" "[[DEVICELIST:.+\.txt]]" diff --git a/clang/test/Driver/sycl-offload-win-old-model.c b/clang/test/Driver/sycl-offload-win-old-model.c index 42761818359ff..70162d99da3e5 100644 --- a/clang/test/Driver/sycl-offload-win-old-model.c +++ b/clang/test/Driver/sycl-offload-win-old-model.c @@ -9,11 +9,11 @@ // RUN: echo "void foo() {}" > %t.c // RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -c -Fo%t-orig.obj %t.c // RUN: llvm-ar cr %t-orig.lib %t-orig.obj -// RUN: %clang --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t-orig.lib %t-orig.obj -### 2>&1 \ +// RUN: %clang --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t-orig.lib %t-orig.obj -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB -// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t-orig.lib %t-orig.obj -### 2>&1 \ +// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t-orig.lib %t-orig.obj -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB -// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-device-lib=all %t-orig.obj -### /link %t-orig.lib 2>&1 \ +// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver --no-offloadlib %t-orig.obj -### /link %t-orig.lib 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB // FOFFLOAD_STATIC_LIB: clang-offload-bundler{{(.exe)?}}{{.+}} "-type=o" "-targets=host-x86_64-pc-windows-msvc,sycl-spir64-unknown-unknown" "-input={{.*}}-orig.obj" "-output={{.+}}.{{(o|obj)}}" "-output={{.+}}.{{(o|obj)}}" "-unbundle" // FOFFLOAD_STATIC_LIB: clang-offload-bundler{{(.exe)?}}{{.+}} "-type=aoo" "-targets=sycl-spir64-{{.+}}" "-input={{.*}}-orig.lib" "-output=[[OUTLIB:.+\.txt]]" "-unbundle" @@ -23,15 +23,15 @@ // RUN: mkdir -p %t_dir // RUN: llvm-ar cr %t_dir/%basename_t-orig2.lib %t-orig.obj -// RUN: %clang --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-device-lib=all %t_dir/%basename_t-orig2.lib %t-orig.obj -### 2>&1 \ +// RUN: %clang --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver --no-offloadlib %t_dir/%basename_t-orig2.lib %t-orig.obj -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB2 -// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-device-lib=all %t_dir/%basename_t-orig2.lib %t-orig.obj -### 2>&1 \ +// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver --no-offloadlib %t_dir/%basename_t-orig2.lib %t-orig.obj -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB2 -// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-device-lib=all %t-orig.obj -### /link %t_dir/%basename_t-orig2.lib 2>&1 \ +// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver --no-offloadlib %t-orig.obj -### /link %t_dir/%basename_t-orig2.lib 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB2 -// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-device-lib=all %t-orig.obj -### /link -libpath:%t_dir %basename_t-orig2.lib 2>&1 \ +// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver --no-offloadlib %t-orig.obj -### /link -libpath:%t_dir %basename_t-orig2.lib 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB2 -// RUN: env LIB=%t_dir %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-device-lib=all %t-orig.obj -### /link %basename_t-orig2.lib 2>&1 \ +// RUN: env LIB=%t_dir %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver --no-offloadlib %t-orig.obj -### /link %basename_t-orig2.lib 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB2 // FOFFLOAD_STATIC_LIB2: clang-offload-bundler{{(.exe)?}}{{.+}} "-type=o" "-targets=host-x86_64-pc-windows-msvc,sycl-spir64-unknown-unknown" "-input={{.*}}-orig.obj" "-output={{.+}}.{{(o|obj)}}" "-output={{.+}}.{{(o|obj)}}" "-unbundle" // FOFFLOAD_STATIC_LIB2: clang-offload-bundler{{(.exe)?}}{{.+}} "-type=aoo" "-targets=sycl-spir64-{{.+}}" "-input={{.*}}-orig2.lib" "-output=[[OUTLIB:.+\.txt]]" "-unbundle" @@ -80,9 +80,9 @@ /// Test behaviors of using static libraries from source. // RUN: touch %t-orig.lib -// RUN: %clang --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t-orig.lib -ccc-print-phases %s 2>&1 \ +// RUN: %clang --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t-orig.lib -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB_SRC -// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t-orig.lib -ccc-print-phases %s 2>&1 \ +// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t-orig.lib -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB_SRC // FOFFLOAD_STATIC_LIB_SRC: 0: input, "[[INPUTLIB:.+\.lib]]", object, (host-sycl) // FOFFLOAD_STATIC_LIB_SRC: 1: input, "[[INPUTC:.+\.c]]", c++, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-with-split-old-model.c b/clang/test/Driver/sycl-offload-with-split-old-model.c index 83c142e6ce0d7..98f615cec488d 100644 --- a/clang/test/Driver/sycl-offload-with-split-old-model.c +++ b/clang/test/Driver/sycl-offload-with-split-old-model.c @@ -11,17 +11,17 @@ /// preprocessor and another one joining the device linking outputs to the host /// action. The same graph should be generated when no -fsycl-targets is used /// The same phase graph will be used with -fsycl-device-obj=llvmir -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-targets=spir64-unknown-unknown -- %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split=per_source -fsycl-targets=spir64-unknown-unknown -- %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=spirv %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split=per_source -fsycl-device-obj=spirv %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=spirv -- %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split=per_source -fsycl-device-obj=spirv -- %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=llvmir %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split=per_source -fsycl-device-obj=llvmir %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=llvmir -- %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split=per_source -fsycl-device-obj=llvmir -- %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s // CHK-PHASES: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -46,7 +46,7 @@ /// Check the phases also add a library to make sure it is treated as input by /// the device. -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-LIB %s // CHK-PHASES-LIB: 0: input, "somelib", object, (host-sycl) // CHK-PHASES-LIB: 1: input, "[[INPUT:.+\.c]]", c++, (host-sycl) @@ -71,7 +71,7 @@ /// Check the phases when using and multiple source files // RUN: echo " " > %t.c -// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown %s %t.c 2>&1 \ +// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown %s %t.c 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-FILES %s // CHK-PHASES-FILES: 0: input, "somelib", object, (host-sycl) @@ -106,11 +106,11 @@ /// Check separate compilation with offloading - unbundling actions // RUN: touch %t.o -// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -o %t.out -lsomelib -fsycl-targets=spir64-unknown-unknown %t.o 2>&1 \ +// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -o %t.out -lsomelib -fsycl-targets=spir64-unknown-unknown %t.o 2>&1 \ // RUN: | FileCheck -DINPUT=%t.o -check-prefix=CHK-UBACTIONS %s // RUN: mkdir -p %t_dir // RUN: touch %t_dir/dummy -// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -o %t.out -lsomelib -fsycl-targets=spir64-unknown-unknown %t_dir/dummy 2>&1 \ +// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -o %t.out -lsomelib -fsycl-targets=spir64-unknown-unknown %t_dir/dummy 2>&1 \ // RUN: | FileCheck -DINPUT=%t_dir/dummy -check-prefix=CHK-UBACTIONS %s // CHK-UBACTIONS: 0: input, "somelib", object, (host-sycl) // CHK-UBACTIONS: 1: input, "[[INPUT]]", object, (host-sycl) @@ -129,7 +129,7 @@ /// Check separate compilation with offloading - unbundling with source // RUN: touch %t.o -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split %t.o -fsycl-targets=spir64-unknown-unknown %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split %t.o -fsycl-targets=spir64-unknown-unknown %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-UBUACTIONS %s // CHK-UBUACTIONS: 0: input, "somelib", object, (host-sycl) // CHK-UBUACTIONS: 1: input, "[[INPUT1:.+\.o]]", object, (host-sycl) @@ -156,9 +156,9 @@ /// ########################################################################### /// Ahead of Time compilation for gen, cpu -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-CPU // CHK-PHASES-AOT: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES-AOT: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -184,9 +184,9 @@ /// ########################################################################### /// Ahead of Time compilation for gen, cpu - tool invocation -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-CPU // CHK-TOOLS-AOT: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INPUT1:.+\-header.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[OUTPUT1:.+\.bc]]" // CHK-TOOLS-AOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-o" "[[OUTPUT10:.+\.o]]" @@ -218,7 +218,7 @@ /// ########################################################################### /// offload with multiple targets, including AOT -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown,spir64_x86_64-unknown-unknown,spir64_gen-unknown-unknown -ccc-print-phases %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown,spir64_x86_64-unknown-unknown,spir64_gen-unknown-unknown -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASE-MULTI-TARG %s // CHK-PHASE-MULTI-TARG: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASE-MULTI-TARG: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-with-split.c b/clang/test/Driver/sycl-offload-with-split.c index c61b2981aca9b..85f09910ab201 100644 --- a/clang/test/Driver/sycl-offload-with-split.c +++ b/clang/test/Driver/sycl-offload-with-split.c @@ -7,9 +7,9 @@ /// ########################################################################### /// Ahead of Time compilation for gen, cpu - tool invocation -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT // CHK-TOOLS-AOT: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INPUT1:.+\-header.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[OUTPUT1:.+\.bc]]" // CHK-TOOLS-AOT: clang-offload-packager{{.*}} diff --git a/clang/test/Driver/sycl-offload.c b/clang/test/Driver/sycl-offload.c index a58f785c20c42..10beddea84345 100644 --- a/clang/test/Driver/sycl-offload.c +++ b/clang/test/Driver/sycl-offload.c @@ -129,11 +129,11 @@ /// We should have an offload action joining the host compile and device /// preprocessor and another one joining the device linking outputs to the host /// action. -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES %s -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES %s // CHK-PHASES: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -155,9 +155,9 @@ /// We should have an offload action joining the host compile and device /// preprocessor and another one joining the device linking outputs to the host /// action. -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fsycl-targets=spirv64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fsycl-targets=spirv64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES-2 %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --offload-new-driver -fsycl-targets=spirv64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --offload-new-driver -fsycl-targets=spirv64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES-2 %s // CHK-PHASES-2: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES-2: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -185,7 +185,7 @@ /// Check the phases also add a library to make sure it is treated as input by /// the device. -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-LIB %s // CHK-PHASES-LIB: 0: input, "somelib", object, (host-sycl) // CHK-PHASES-LIB: 1: input, "[[INPUT:.+\.c]]", c++, (host-sycl) @@ -206,7 +206,7 @@ /// Check the phases when using and multiple source files // RUN: echo " " > %t.c -// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %s %t.c 2>&1 \ +// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -fno-sycl-instrument-device-code --no-offloadlib %s %t.c 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-FILES %s // CHK-PHASES-FILES: 0: input, "somelib", object, (host-sycl) // CHK-PHASES-FILES: 1: input, "[[INPUT1:.+\.c]]", c++, (host-sycl) @@ -395,7 +395,7 @@ /// ########################################################################### /// Verify that triple-boundarch pairs are correct with multi-targetting -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=nvptx64-nvidia-cuda,spir64 -ccc-print-phases %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=nvptx64-nvidia-cuda,spir64 -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASE-MULTI-TARG-BOUND-ARCH %s // CHK-PHASE-MULTI-TARG-BOUND-ARCH: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASE-MULTI-TARG-BOUND-ARCH: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -417,7 +417,7 @@ // CHK-PHASE-MULTI-TARG-BOUND-ARCH: 17: clang-linker-wrapper, {16}, image, (host-sycl) // RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver \ -// RUN: -fno-sycl-instrument-device-code -fno-sycl-device-lib=all \ +// RUN: -fno-sycl-instrument-device-code --no-offloadlib \ // RUN: -fsycl-targets=nvptx64-nvidia-cuda,spir64_gen \ // RUN: -Xsycl-target-backend=spir64_gen "-device skl" \ // RUN: -ccc-print-phases %s 2>&1 \ @@ -444,7 +444,7 @@ /// ########################################################################### // Check if valid bound arch behaviour occurs when compiling for spir-v,nvidia-gpu, and amd-gpu -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-targets=spir64,nvptx64-nvidia-cuda,amdgcn-amd-amdhsa -Xsycl-target-backend=nvptx64-nvidia-cuda --offload-arch=sm_75 -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx908 -ccc-print-phases %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -fsycl-targets=spir64,nvptx64-nvidia-cuda,amdgcn-amd-amdhsa -Xsycl-target-backend=nvptx64-nvidia-cuda --offload-arch=sm_75 -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx908 -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD %s // CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASE-MULTI-TARG-SPIRV-NVIDIA-AMD: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -479,9 +479,9 @@ /// passing of a library should not trigger the unbundler // RUN: touch %t.a // RUN: touch %t.lib -// RUN: %clang -ccc-print-phases -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t.a %s 2>&1 \ +// RUN: %clang -ccc-print-phases -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t.a %s 2>&1 \ // RUN: | FileCheck -check-prefix=LIB-UNBUNDLE-CHECK %s -// RUN: %clang_cl -ccc-print-phases -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all %t.lib %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib %t.lib %s 2>&1 \ // RUN: | FileCheck -check-prefix=LIB-UNBUNDLE-CHECK %s // LIB-UNBUNDLE-CHECK-NOT: clang-offload-unbundler diff --git a/clang/test/Driver/sycl-oneapi-gpu-amdgpu.cpp b/clang/test/Driver/sycl-oneapi-gpu-amdgpu.cpp index 7bfff859d9222..ed7e887e2ca69 100644 --- a/clang/test/Driver/sycl-oneapi-gpu-amdgpu.cpp +++ b/clang/test/Driver/sycl-oneapi-gpu-amdgpu.cpp @@ -171,7 +171,7 @@ /// AMD Test phases, BoundArch settings used for -device target. Additional /// offload action used for compilation and backend compilation. -// RUN: %clangxx -fsycl -fsycl-targets=amd_gpu_gfx700 -fno-sycl-device-lib=all \ +// RUN: %clangxx -fsycl -fsycl-targets=amd_gpu_gfx700 --no-offloadlib \ // RUN: -fno-sycl-instrument-device-code \ // RUN: -target x86_64-unknown-linux-gnu -ccc-print-phases %s 2>&1 | \ // RUN: FileCheck %s --check-prefix=AMD_CHECK_PHASES diff --git a/clang/test/Driver/sycl-oneapi-gpu-intelgpu.cpp b/clang/test/Driver/sycl-oneapi-gpu-intelgpu.cpp index 09cefd88c6aa7..b85cbb3190474 100644 --- a/clang/test/Driver/sycl-oneapi-gpu-intelgpu.cpp +++ b/clang/test/Driver/sycl-oneapi-gpu-intelgpu.cpp @@ -209,7 +209,7 @@ /// Test phases, BoundArch settings used for -device target. Additional /// offload action used for compilation and backend compilation. -// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_skl -fno-sycl-device-lib=all \ +// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_skl --no-offloadlib \ // RUN: -fno-sycl-instrument-device-code \ // RUN: -target x86_64-unknown-linux-gnu -ccc-print-phases %s 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK_PHASES @@ -236,7 +236,7 @@ /// when mixing spir64_gen and intel_gpu // RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg1,spir64_gen \ // RUN: -Xsycl-target-backend=spir64_gen "-device skl" \ -// RUN: -fno-sycl-device-lib=all -fno-sycl-instrument-device-code \ +// RUN: --no-offloadlib -fno-sycl-instrument-device-code \ // RUN: -target x86_64-unknown-linux-gnu -### %s 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK_TOOLS_MIX // CHECK_TOOLS_MIX: clang{{.*}} "-triple" "spir64_gen-unknown-unknown" @@ -248,7 +248,7 @@ /// Test phases when using both spir64_gen and intel_gpu* // RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_skl,spir64_gen \ -// RUN: -fno-sycl-device-lib=all -fno-sycl-instrument-device-code \ +// RUN: --no-offloadlib -fno-sycl-instrument-device-code \ // RUN: -target x86_64-unknown-linux-gnu -ccc-print-phases %s 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK_PHASES_MIX // CHECK_PHASES_MIX: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl) @@ -287,7 +287,7 @@ // RUN: -Xsycl-target-backend=spir64_gen "-device skl -DSKL" \ // RUN: -Xsycl-target-backend=intel_gpu_dg1 "-DDG1" \ // RUN: -Xsycl-target-backend=intel_gpu_skl "-DSKL2" \ -// RUN: -fno-sycl-device-lib=all -fno-sycl-instrument-device-code \ +// RUN: --no-offloadlib -fno-sycl-instrument-device-code \ // RUN: -target x86_64-unknown-linux-gnu -### %s 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK_TOOLS_BEOPTS // CHECK_TOOLS_BEOPTS: ocloc{{.*}} "-device" "dg1"{{.*}}"-DDG1" @@ -300,7 +300,7 @@ // RUN: -fsycl -Xsycl-target-backend=spir64_x86_64 "-DCPU" \ // RUN: -Xsycl-target-backend=intel_gpu_dg1 "-DDG1" \ // RUN: -Xsycl-target-backend=intel_gpu_skl "-DSKL2" \ -// RUN: -fno-sycl-device-lib=all -fno-sycl-instrument-device-code \ +// RUN: --no-offloadlib -fno-sycl-instrument-device-code \ // RUN: -target x86_64-unknown-linux-gnu -### %s 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK_TOOLS_BEOPTS_MIX // CHECK_TOOLS_BEOPTS_MIX: ocloc{{.*}} "-device" "dg1"{{.*}}"-DDG1" diff --git a/clang/test/Driver/sycl-oneapi-gpu-nvidia.cpp b/clang/test/Driver/sycl-oneapi-gpu-nvidia.cpp index 3513b0f3d9315..0925795e00c2b 100644 --- a/clang/test/Driver/sycl-oneapi-gpu-nvidia.cpp +++ b/clang/test/Driver/sycl-oneapi-gpu-nvidia.cpp @@ -82,7 +82,7 @@ /// NVIDIA Test phases, BoundArch settings used for -device target. Additional /// offload action used for compilation and backend compilation. -// RUN: %clangxx -fsycl -fsycl-targets=nvidia_gpu_sm_50 -fno-sycl-device-lib=all \ +// RUN: %clangxx -fsycl -fsycl-targets=nvidia_gpu_sm_50 --no-offloadlib \ // RUN: -fno-sycl-instrument-device-code --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \ // RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/share/clc/remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc \ // RUN: -target x86_64-unknown-linux-gnu -ccc-print-phases %s 2>&1 | \ @@ -98,15 +98,14 @@ // NVIDIA_CHECK_PHASES: 8: assembler, {7}, object, (host-sycl) // NVIDIA_CHECK_PHASES: 9: linker, {4}, ir, (device-sycl, sm_50) // NVIDIA_CHECK_PHASES: 10: input, "{{.*}}libspirv-nvptx64{{.*}}", ir, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 11: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 12: linker, {9, 10, 11}, ir, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 13: sycl-post-link, {12}, ir, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 14: file-table-tform, {13}, ir, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 15: backend, {14}, assembler, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 16: assembler, {15}, object, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 17: linker, {15, 16}, cuda-fatbin, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 18: foreach, {14, 17}, cuda-fatbin, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 19: file-table-tform, {13, 18}, tempfiletable, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 20: clang-offload-wrapper, {19}, object, (device-sycl, sm_50) -// NVIDIA_CHECK_PHASES: 21: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {20}, object -// NVIDIA_CHECK_PHASES: 22: linker, {8, 21}, image, (host-sycl) +// NVIDIA_CHECK_PHASES: 11: linker, {9, 10}, ir, (device-sycl, sm_50) +// NVIDIA_CHECK_PHASES: 12: sycl-post-link, {11}, ir, (device-sycl, sm_50) +// NVIDIA_CHECK_PHASES: 13: file-table-tform, {12}, ir, (device-sycl, sm_50) +// NVIDIA_CHECK_PHASES: 14: backend, {13}, assembler, (device-sycl, sm_50) +// NVIDIA_CHECK_PHASES: 15: assembler, {14}, object, (device-sycl, sm_50) +// NVIDIA_CHECK_PHASES: 16: linker, {14, 15}, cuda-fatbin, (device-sycl, sm_50) +// NVIDIA_CHECK_PHASES: 17: foreach, {13, 16}, cuda-fatbin, (device-sycl, sm_50) +// NVIDIA_CHECK_PHASES: 18: file-table-tform, {12, 17}, tempfiletable, (device-sycl, sm_50) +// NVIDIA_CHECK_PHASES: 19: clang-offload-wrapper, {18}, object, (device-sycl, sm_50) +// NVIDIA_CHECK_PHASES: 20: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {19}, object +// NVIDIA_CHECK_PHASES: 21: linker, {8, 20}, image, (host-sycl) diff --git a/clang/test/Driver/sycl-save-offload-code-old-model.cpp b/clang/test/Driver/sycl-save-offload-code-old-model.cpp index d4db941cbc66f..383590ae393a8 100644 --- a/clang/test/Driver/sycl-save-offload-code-old-model.cpp +++ b/clang/test/Driver/sycl-save-offload-code-old-model.cpp @@ -5,7 +5,7 @@ // Linux // clang -fsycl --no-offload-new-driver -target x86_64-unknown-linux-gnu -// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -save-offload-code=/user/input/path %s -### 2>&1 \ +// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -target x86_64-unknown-linux-gnu -save-offload-code=/user/input/path %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefixes=CHK-save-offload-code // clang -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown diff --git a/clang/test/Driver/sycl-save-offload-code.cpp b/clang/test/Driver/sycl-save-offload-code.cpp index 1bd5fb32330a4..d9a0a1eafbaea 100644 --- a/clang/test/Driver/sycl-save-offload-code.cpp +++ b/clang/test/Driver/sycl-save-offload-code.cpp @@ -4,7 +4,7 @@ // clang-linker-wrapper in the new offload model. // clang -fsycl --offload-new-driver -target x86_64-unknown-linux-gnu -// RUN: %clang -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -save-offload-code=/user/input/path %s -### 2>&1 \ +// RUN: %clang -fsycl --offload-new-driver -fno-sycl-instrument-device-code --no-offloadlib -target x86_64-unknown-linux-gnu -save-offload-code=/user/input/path %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefixes=CHK-save-offload-code-NEW-OFFLOAD // clang -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown diff --git a/clang/test/Driver/sycl-specific-args-diagnostics.cpp b/clang/test/Driver/sycl-specific-args-diagnostics.cpp index db8e10de7932c..b6fb26aff52bf 100644 --- a/clang/test/Driver/sycl-specific-args-diagnostics.cpp +++ b/clang/test/Driver/sycl-specific-args-diagnostics.cpp @@ -22,12 +22,6 @@ // RUN: %clang_cl -### -fsycl-dead-args-optimization %s 2>&1 \ // RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-dead-args-optimization %s -// Warning should be emitted when using -fsycl-device-lib-jit-link without -fsycl -// RUN: %clang -### -fsycl-device-lib-jit-link %s 2>&1 \ -// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-lib-jit-link %s -// RUN: %clang_cl -### -fsycl-device-lib-jit-link %s 2>&1 \ -// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-lib-jit-link %s - // Warning should be emitted when using -fsycl-default-sub-group-size= without -fsycl // RUN: %clang -### -fsycl-default-sub-group-size=10 %s 2>&1 \ // RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-default-sub-group-size=10 %s @@ -38,12 +32,6 @@ // RUN: %clang -### -fsycl-device-code-split-esimd %s 2>&1 \ // RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-code-split-esimd %s -// Warning should be emitted when using -fsycl-device-lib=libc without -fsycl -// RUN: %clang -### -fsycl-device-lib=libc %s 2>&1 \ -// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-lib=libc %s -// RUN: %clang_cl -### -fsycl-device-lib=libc %s 2>&1 \ -// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-lib=libc %s - // Warning should be emitted when using -fsycl-device-obj=spirv without -fsycl // RUN: %clang -### -fsycl-device-obj=spirv %s 2>&1 \ // RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-obj=spirv %s diff --git a/sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp b/sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp index 1bc0b92d84db0..c90f2c97c8116 100644 --- a/sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp +++ b/sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp @@ -467,107 +467,58 @@ Expected jit_compiler::compileDeviceCode( // This function is a simplified copy of the device library selection process // in `clang::driver::tools::SYCL::getDeviceLibraries`, assuming a SPIR-V, or -// GPU targets (no AoT, no native CPU). Keep in sync! -static bool getDeviceLibraries(const ArgList &Args, +// GPU targets (no native CPU). Keep in sync! +static void getDeviceLibraries(const ArgList &Args, SmallVectorImpl &LibraryList, - DiagnosticsEngine &Diags, BinaryFormat Format) { + BinaryFormat Format) { // For CUDA/HIP we only need devicelib, early exit here. if (Format == BinaryFormat::PTX) { LibraryList.push_back( Args.MakeArgString("devicelib-nvptx64-nvidia-cuda.bc")); - return false; + return; } else if (Format == BinaryFormat::AMDGCN) { LibraryList.push_back(Args.MakeArgString("devicelib-amdgcn-amd-amdhsa.bc")); - return false; + return; } - struct DeviceLibOptInfo { - StringRef DeviceLibName; - StringRef DeviceLibOption; - }; - - // Currently, all SYCL device libraries will be linked by default. - llvm::StringMap DeviceLibLinkInfo = { - {"libc", true}, {"libm-fp32", true}, {"libm-fp64", true}, - {"libimf-fp32", true}, {"libimf-fp64", true}, {"libimf-bf16", true}, - {"libm-bfloat16", true}, {"internal", true}}; - - // If -fno-sycl-device-lib is specified, its values will be used to exclude - // linkage of libraries specified by DeviceLibLinkInfo. Linkage of "internal" - // libraries cannot be affected via -fno-sycl-device-lib. - bool ExcludeDeviceLibs = false; - - bool FoundUnknownLib = false; - - if (Arg *A = Args.getLastArg(OPT_fsycl_device_lib_EQ, - OPT_fno_sycl_device_lib_EQ)) { - if (A->getValues().size() == 0) { - Diags.Report(diag::warn_drv_empty_joined_argument) - << A->getAsString(Args); - } else { - if (A->getOption().matches(OPT_fno_sycl_device_lib_EQ)) { - ExcludeDeviceLibs = true; - } - - for (StringRef Val : A->getValues()) { - if (Val == "all") { - for (const auto &K : DeviceLibLinkInfo.keys()) { - DeviceLibLinkInfo[K] = (K == "internal") || !ExcludeDeviceLibs; - } - break; - } - auto LinkInfoIter = DeviceLibLinkInfo.find(Val); - if (LinkInfoIter == DeviceLibLinkInfo.end() || Val == "internal") { - Diags.Report(diag::err_drv_unsupported_option_argument) - << A->getSpelling() << Val; - FoundUnknownLib = true; - } - DeviceLibLinkInfo[Val] = !ExcludeDeviceLibs; - } - } - } - - using SYCLDeviceLibsList = SmallVector; - - const SYCLDeviceLibsList SYCLDeviceWrapperLibs = { - {"libsycl-crt", "libc"}, - {"libsycl-complex", "libm-fp32"}, - {"libsycl-complex-fp64", "libm-fp64"}, - {"libsycl-cmath", "libm-fp32"}, - {"libsycl-cmath-fp64", "libm-fp64"}, + using SYCLDeviceLibsList = SmallVector; + const SYCLDeviceLibsList SYCLDeviceLibs = {"libsycl-crt", + "libsycl-complex", + "libsycl-complex-fp64", + "libsycl-cmath", + "libsycl-cmath-fp64", #if defined(_WIN32) - {"libsycl-msvc-math", "libm-fp32"}, + "libsycl-msvc-math", #endif - {"libsycl-imf", "libimf-fp32"}, - {"libsycl-imf-fp64", "libimf-fp64"}, - {"libsycl-imf-bf16", "libimf-bf16"}}; - // ITT annotation libraries are linked in separately whenever the device - // code instrumentation is enabled. - const SYCLDeviceLibsList SYCLDeviceAnnotationLibs = { - {"libsycl-itt-user-wrappers", "internal"}, - {"libsycl-itt-compiler-wrappers", "internal"}, - {"libsycl-itt-stubs", "internal"}}; + "libsycl-imf", + "libsycl-imf-fp64", + "libsycl-imf-bf16", + "libsycl-fallback-cassert", + "libsycl-fallback-cstring", + "libsycl-fallback-complex", + "libsycl-fallback-complex-fp64", + "libsycl-fallback-cmath", + "libsycl-fallback-cmath-fp64", + "libsycl-fallback-imf", + "libsycl-fallback-imf-fp64", + "libsycl-fallback-imf-bf16"}; StringRef LibSuffix = ".bc"; auto AddLibraries = [&](const SYCLDeviceLibsList &LibsList) { - for (const DeviceLibOptInfo &Lib : LibsList) { - if (!DeviceLibLinkInfo[Lib.DeviceLibOption]) { - continue; - } - SmallString<128> LibName(Lib.DeviceLibName); - llvm::sys::path::replace_extension(LibName, LibSuffix); - LibraryList.push_back(Args.MakeArgString(LibName)); + for (const StringRef &Lib : LibsList) { + LibraryList.push_back(Args.MakeArgString(Twine(Lib) + LibSuffix)); } }; - AddLibraries(SYCLDeviceWrapperLibs); + AddLibraries(SYCLDeviceLibs); + const SYCLDeviceLibsList SYCLDeviceAnnotationLibs = { + "libsycl-itt-user-wrappers", "libsycl-itt-compiler-wrappers", + "libsycl-itt-stubs"}; if (Args.hasFlag(OPT_fsycl_instrument_device_code, OPT_fno_sycl_instrument_device_code, false)) { AddLibraries(SYCLDeviceAnnotationLibs); } - - return FoundUnknownLib; } Error jit_compiler::linkDeviceLibraries(llvm::Module &Module, @@ -583,12 +534,7 @@ Error jit_compiler::linkDeviceLibraries(llvm::Module &Module, /* ShouldOwnClient=*/false); SmallVector LibNames; - const bool FoundUnknownLib = - getDeviceLibraries(UserArgList, LibNames, Diags, Format); - if (FoundUnknownLib) { - return createStringError("Could not determine list of device libraries: %s", - BuildLog.c_str()); - } + getDeviceLibraries(UserArgList, LibNames, Format); const bool IsCudaHIP = Format == BinaryFormat::PTX || Format == BinaryFormat::AMDGCN; if (IsCudaHIP) { diff --git a/sycl/test-e2e/DeviceImageDependencies/NewOffloadDriver/math_device_lib.cpp b/sycl/test-e2e/DeviceImageDependencies/NewOffloadDriver/math_device_lib.cpp deleted file mode 100644 index 0f1dc232a1477..0000000000000 --- a/sycl/test-e2e/DeviceImageDependencies/NewOffloadDriver/math_device_lib.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// REQUIRES: aspect-fp64 - -// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} - -// RUN: %{build} --offload-new-driver -fsycl-allow-device-image-dependencies %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} %{mathflags} -o %t.out -// RUN: %{run} %t.out - -// XFAIL: target-native_cpu -// XFAIL-TRACKER: https://github.com/intel/llvm/issues/20142 - -#include -#include - -using namespace sycl; - -// Check that device lib dependencies are resolved with -// -fsycl-allow-device-image-dependencies. -// TODO this test will become redundant once -// -fsycl-allow-device-image-dependencies is enabled by default. -int main() { - range<1> Range{1}; - queue q; - buffer buffer1(Range); - q.submit([&](sycl::handler &cgh) { - auto Acc = buffer1.get_access(cgh); - cgh.single_task([=]() { Acc[0] = std::acosh(1.0); }); - }); - return 0; -} diff --git a/sycl/test-e2e/DeviceImageDependencies/math_device_lib.cpp b/sycl/test-e2e/DeviceImageDependencies/math_device_lib.cpp deleted file mode 100644 index 8165a33c4e55e..0000000000000 --- a/sycl/test-e2e/DeviceImageDependencies/math_device_lib.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// REQUIRES: aspect-fp64 - -// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} - -// RUN: %{build} -fsycl-allow-device-image-dependencies %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} %{mathflags} -o %t.out -// RUN: %{run} %t.out - -// XFAIL: target-native_cpu -// XFAIL-TRACKER: https://github.com/intel/llvm/issues/20142 - -#include -#include - -using namespace sycl; - -// Check that device lib dependencies are resolved with -// -fsycl-allow-device-image-dependencies. -// TODO this test will become redundant once -// -fsycl-allow-device-image-dependencies is enabled by default. -int main() { - range<1> Range{1}; - queue q; - buffer buffer1(Range); - q.submit([&](sycl::handler &cgh) { - auto Acc = buffer1.get_access(cgh); - cgh.single_task([=]() { Acc[0] = std::acosh(1.0); }); - }); - return 0; -} diff --git a/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp b/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp index 1c5edc8b626a5..1f1463ba7df36 100644 --- a/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp @@ -5,9 +5,6 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link -Wno-deprecated %{mathflags} -o %t2.out %} -// RUN: %if target-spir %{ %{run} %t2.out %} - #include "math_utils.hpp" #include #include diff --git a/sycl/test-e2e/DeviceLib/cmath_test.cpp b/sycl/test-e2e/DeviceLib/cmath_test.cpp index f9156f168dfe2..911f0a77d5b22 100644 --- a/sycl/test-e2e/DeviceLib/cmath_test.cpp +++ b/sycl/test-e2e/DeviceLib/cmath_test.cpp @@ -3,9 +3,6 @@ // RUN: %{build} -fno-builtin %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fno-builtin -fsycl-device-lib-jit-link -Wno-deprecated %{mathflags} -o %t2.out %} -// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} -// // // Check that --fast-math works with cmath funcs for CUDA // RUN: %if target-nvidia %{ %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda %s -Wno-nan-infinity-disabled -fno-builtin %{mathflags} -o %t3.out -ffast-math -DSYCL_E2E_FASTMATH %} // RUN: %if cuda %{ %{run} %t3.out %} diff --git a/sycl/test-e2e/DeviceLib/imf/bfloat16_integeral_convesions.cpp b/sycl/test-e2e/DeviceLib/imf/bfloat16_integeral_convesions.cpp index 42c770fa0c084..4b35dc7985f7c 100644 --- a/sycl/test-e2e/DeviceLib/imf/bfloat16_integeral_convesions.cpp +++ b/sycl/test-e2e/DeviceLib/imf/bfloat16_integeral_convesions.cpp @@ -1,9 +1,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - #include "imf_utils.hpp" #include #include diff --git a/sycl/test-e2e/DeviceLib/imf/double2bfloat16.cpp b/sycl/test-e2e/DeviceLib/imf/double2bfloat16.cpp index a67a73fd5d2ec..c2c15f4c61032 100644 --- a/sycl/test-e2e/DeviceLib/imf/double2bfloat16.cpp +++ b/sycl/test-e2e/DeviceLib/imf/double2bfloat16.cpp @@ -3,9 +3,6 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t1.out -// RUN: %{run} %t1.out - #include "imf_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/imf/double2half.cpp b/sycl/test-e2e/DeviceLib/imf/double2half.cpp index 908c30f9dd930..7492a9f8eca85 100644 --- a/sycl/test-e2e/DeviceLib/imf/double2half.cpp +++ b/sycl/test-e2e/DeviceLib/imf/double2half.cpp @@ -4,9 +4,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - #include "imf_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/imf/float2bfloat16.cpp b/sycl/test-e2e/DeviceLib/imf/float2bfloat16.cpp index 80f548ea21611..d582e49f3751f 100644 --- a/sycl/test-e2e/DeviceLib/imf/float2bfloat16.cpp +++ b/sycl/test-e2e/DeviceLib/imf/float2bfloat16.cpp @@ -1,9 +1,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - // All __imf_* bf16 functions are implemented via fp32 emulation, so we don't // need to check whether underlying device supports bf16 or not. #include "imf_utils.hpp" diff --git a/sycl/test-e2e/DeviceLib/imf/fp32_rounding_test.cpp b/sycl/test-e2e/DeviceLib/imf/fp32_rounding_test.cpp index e11b05c9aa6c4..bcad6b26db999 100644 --- a/sycl/test-e2e/DeviceLib/imf/fp32_rounding_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf/fp32_rounding_test.cpp @@ -1,9 +1,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - #include "imf_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/imf/fp32_test.cpp b/sycl/test-e2e/DeviceLib/imf/fp32_test.cpp index a2826995269a9..1f60de7c334b2 100644 --- a/sycl/test-e2e/DeviceLib/imf/fp32_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf/fp32_test.cpp @@ -1,9 +1,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - #include "imf_utils.hpp" #include namespace s = sycl; diff --git a/sycl/test-e2e/DeviceLib/imf/fp64_rounding_test.cpp b/sycl/test-e2e/DeviceLib/imf/fp64_rounding_test.cpp index a07d8e3c4d4bd..684e471436764 100644 --- a/sycl/test-e2e/DeviceLib/imf/fp64_rounding_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf/fp64_rounding_test.cpp @@ -2,9 +2,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - // Depends on SPIR-V Backend & run-time drivers version. // XFAIL: spirv-backend && run-mode // XFAIL-TRACKER: CMPLRLLVM-64705 diff --git a/sycl/test-e2e/DeviceLib/imf/fp64_test.cpp b/sycl/test-e2e/DeviceLib/imf/fp64_test.cpp index 98723fb0f16db..e9d132e8db651 100644 --- a/sycl/test-e2e/DeviceLib/imf/fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf/fp64_test.cpp @@ -2,9 +2,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - #include "imf_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/imf/fp64_test2.cpp b/sycl/test-e2e/DeviceLib/imf/fp64_test2.cpp index 6e84dee35d7ed..e23883c254b6c 100644 --- a/sycl/test-e2e/DeviceLib/imf/fp64_test2.cpp +++ b/sycl/test-e2e/DeviceLib/imf/fp64_test2.cpp @@ -2,9 +2,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - #include "imf_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/imf/half_type_cast.cpp b/sycl/test-e2e/DeviceLib/imf/half_type_cast.cpp index 8059ceea13f57..d1bc4a156ea9c 100644 --- a/sycl/test-e2e/DeviceLib/imf/half_type_cast.cpp +++ b/sycl/test-e2e/DeviceLib/imf/half_type_cast.cpp @@ -4,9 +4,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - // Depends on SPIR-V Backend & run-time drivers version. // XFAIL: spirv-backend && run-mode // XFAIL-TRACKER: CMPLRLLVM-64705 diff --git a/sycl/test-e2e/DeviceLib/imf/simd_emulate_test.cpp b/sycl/test-e2e/DeviceLib/imf/simd_emulate_test.cpp index c4ed55000a46d..d915b620aa301 100644 --- a/sycl/test-e2e/DeviceLib/imf/simd_emulate_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf/simd_emulate_test.cpp @@ -1,9 +1,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link -Wno-deprecated %} -o %t2.out -// RUN: %{run} %t2.out - // UNSUPPORTED: igc-dev // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17008 diff --git a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp index 1cebf0331bfcb..2e3eb85c6f7da 100644 --- a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp @@ -5,9 +5,6 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link -Wno-deprecated %{mathflags} -o %t2.out %} -// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} - #include "math_utils.hpp" #include #include diff --git a/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp b/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp index 012a478a4878b..a228324c43400 100644 --- a/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp @@ -5,9 +5,6 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link -Wno-deprecated %{mathflags} -o %t2.out %} -// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} - #include "math_utils.hpp" #include #include diff --git a/sycl/test-e2e/DeviceLib/math_test.cpp b/sycl/test-e2e/DeviceLib/math_test.cpp index 78f35078dd2b6..f96f7b8be97f8 100644 --- a/sycl/test-e2e/DeviceLib/math_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_test.cpp @@ -3,9 +3,6 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link -Wno-deprecated %{mathflags} -o %t2.out %} -// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} - #include "math_utils.hpp" #include #include diff --git a/sycl/test-e2e/DeviceLib/math_windows_test.cpp b/sycl/test-e2e/DeviceLib/math_windows_test.cpp index 3796c21e3e469..e03a9498aae7f 100644 --- a/sycl/test-e2e/DeviceLib/math_windows_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_windows_test.cpp @@ -7,9 +7,6 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link -Wno-deprecated %{mathflags} -o %t2.out %} -// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} - #include "math_utils.hpp" #include #include diff --git a/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp b/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp index 017c69c57149c..b4a4edaf1c08c 100644 --- a/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp @@ -4,9 +4,6 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link -Wno-deprecated -o %t2.out %} -// RUN: %if target-spir %{ %{run} %t2.out %} - #include #include #include diff --git a/sycl/test-e2e/DeviceLib/std_complex_math_test.cpp b/sycl/test-e2e/DeviceLib/std_complex_math_test.cpp index cc76734c7d16c..8692600a3db9f 100644 --- a/sycl/test-e2e/DeviceLib/std_complex_math_test.cpp +++ b/sycl/test-e2e/DeviceLib/std_complex_math_test.cpp @@ -2,9 +2,6 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link -Wno-deprecated %{mathflags} -o %t2.out %} -// RUN: %if target-spir %{ %{run} %t2.out %} - #include #include #include diff --git a/sycl/test-e2e/DeviceLib/string_test.cpp b/sycl/test-e2e/DeviceLib/string_test.cpp index 5b4e4553163db..e20dc33f0af5f 100644 --- a/sycl/test-e2e/DeviceLib/string_test.cpp +++ b/sycl/test-e2e/DeviceLib/string_test.cpp @@ -1,8 +1,5 @@ // RUN: %{build} -Wno-error=deprecated-declarations -Wno-error=pointer-to-int-cast -fno-builtin -o %t1.out // RUN: %{run} %t1.out -// -// RUN: %if target-spir %{ %{build} -Wno-error=deprecated-declarations -Wno-error=pointer-to-int-cast -fno-builtin -fsycl-device-lib-jit-link -Wno-deprecated -o %t2.out %} -// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} #include #include