From: Gheorghe-Teodor Bercea Date: Tue, 13 Mar 2018 20:50:12 +0000 (+0000) Subject: Revert revision 327438. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edf8cedd1bdc8bd41d00428ae75f650f1a5a5b3b;p=clang Revert revision 327438. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327447 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index ccc4db8fc7..182136f8df 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -203,9 +203,6 @@ def err_drv_expecting_fopenmp_with_fopenmp_targets : Error< def warn_drv_omp_offload_target_duplicate : Warning< "The OpenMP offloading target '%0' is similar to target '%1' already specified - will be ignored.">, InGroup; -def warn_drv_omp_offload_target_missingbcruntime : Warning< - "No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.">, - InGroup; def err_drv_bitcode_unsupported_on_toolchain : Error< "-fembed-bitcode is not supported on versions of iOS prior to 6.0">; diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp index 64e62cb3e0..896505f8e8 100644 --- a/lib/Driver/ToolChains/Cuda.cpp +++ b/lib/Driver/ToolChains/Cuda.cpp @@ -581,44 +581,6 @@ void CudaToolChain::addClangTargetOptions( CC1Args.push_back("-target-feature"); CC1Args.push_back("+ptx42"); } - - if (DeviceOffloadingKind == Action::OFK_OpenMP) { - SmallVector LibraryPaths; - // Add path to lib and/or lib64 folders. - SmallString<256> DefaultLibPath = - llvm::sys::path::parent_path(getDriver().Dir); - llvm::sys::path::append(DefaultLibPath, - Twine("lib") + CLANG_LIBDIR_SUFFIX); - LibraryPaths.emplace_back(DefaultLibPath.c_str()); - - // Add user defined library paths from LIBRARY_PATH. - llvm::Optional LibPath = - llvm::sys::Process::GetEnv("LIBRARY_PATH"); - if (LibPath) { - SmallVector Frags; - const char EnvPathSeparatorStr[] = {llvm::sys::EnvPathSeparator, '\0'}; - llvm::SplitString(*LibPath, Frags, EnvPathSeparatorStr); - for (StringRef Path : Frags) - LibraryPaths.emplace_back(Path.trim()); - } - - std::string LibOmpTargetName = - "libomptarget-nvptx-" + GpuArch.str() + ".bc"; - bool FoundBCLibrary = false; - for (StringRef LibraryPath : LibraryPaths) { - SmallString<128> LibOmpTargetFile(LibraryPath); - llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName); - if (llvm::sys::fs::exists(LibOmpTargetFile)) { - CC1Args.push_back("-mlink-cuda-bitcode"); - CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile)); - FoundBCLibrary = true; - break; - } - } - if (!FoundBCLibrary) - getDriver().Diag(diag::warn_drv_omp_offload_target_missingbcruntime) - << LibOmpTargetName; - } } void CudaToolChain::AddCudaIncludeArgs(const ArgList &DriverArgs, diff --git a/test/Driver/Inputs/libomptarget/libomptarget-nvptx-sm_20.bc b/test/Driver/Inputs/libomptarget/libomptarget-nvptx-sm_20.bc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/Driver/openmp-offload-gpu.c b/test/Driver/openmp-offload-gpu.c index bc1ecccf2f..16c321b9f4 100644 --- a/test/Driver/openmp-offload-gpu.c +++ b/test/Driver/openmp-offload-gpu.c @@ -142,23 +142,3 @@ // RUN: | FileCheck -check-prefix=CHK-NOLIBDEVICE %s // CHK-NOLIBDEVICE-NOT: error:{{.*}}sm_60 - -/// ########################################################################### - -/// Check that the runtime bitcode library is part of the compile line. Create a bogus -/// bitcode library and add it to the LIBRARY_PATH. -// RUN: env LIBRARY_PATH=%S/Inputs/libomptarget %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ -// RUN: -Xopenmp-target -march=sm_20 -fopenmp-relocatable-target -save-temps \ -// RUN: -no-canonical-prefixes %s 2>&1 | FileCheck -check-prefix=CHK-BCLIB %s - -// CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-cuda-bitcode{{.*}}libomptarget-nvptx-sm_20.bc - -/// ########################################################################### - -/// Check that the warning is thrown when the libomptarget bitcode library is not found. -/// Libomptarget requires sm_35 or newer so an sm_20 bitcode library should never exist. -// RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ -// RUN: -Xopenmp-target -march=sm_20 -fopenmp-relocatable-target -save-temps \ -// RUN: -no-canonical-prefixes %s 2>&1 | FileCheck -check-prefix=CHK-BCLIB-WARN %s - -// CHK-BCLIB-WARN: No library 'libomptarget-nvptx-sm_20.bc' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.