From 852234a8798dd5f5401a14b3fd9823cd8b45fbfa Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 25 Sep 2018 18:31:56 +0000 Subject: [PATCH] Revert "[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types." It reverts commit r342991 + several other commits intended to fix the tests. Still have some failed tests, need to investigate it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343002 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Driver.cpp | 12 ------------ test/Driver/Inputs/in.so | 1 - test/Driver/openmp-offload-gpu.c | 4 +--- test/Driver/openmp-offload.c | 2 +- 4 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 test/Driver/Inputs/in.so diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 0b74bbf6df..81369f995d 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -2559,8 +2559,6 @@ class OffloadingActionBuilder final { getDeviceDependences(OffloadAction::DeviceDependences &DA, phases::ID CurPhase, phases::ID FinalPhase, PhasesTy &Phases) override { - if (OpenMPDeviceActions.empty()) - return ABRT_Inactive; // We should always have an action for each input. assert(OpenMPDeviceActions.size() == ToolChains.size() && @@ -2819,16 +2817,6 @@ public: if (CanUseBundler && isa(HostAction) && InputArg->getOption().getKind() == llvm::opt::Option::InputClass && !types::isSrcFile(HostAction->getType())) { - StringRef FileName = InputArg->getAsString(C.getArgs()); - // Check if the type of the file is the same as the action. Do not - // unbundle it if it is not. Do not unbundle .so files, for example, which - // are not object files. - if (HostAction->getType() == types::TY_Object && - llvm::sys::path::has_extension(FileName) && - types::lookupTypeForExtension( - llvm::sys::path::extension(FileName).drop_front()) != - HostAction->getType()) - return false; auto UnbundlingHostAction = C.MakeAction(HostAction); UnbundlingHostAction->registerDependentActionInfo( diff --git a/test/Driver/Inputs/in.so b/test/Driver/Inputs/in.so deleted file mode 100644 index 8b13789179..0000000000 --- a/test/Driver/Inputs/in.so +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/Driver/openmp-offload-gpu.c b/test/Driver/openmp-offload-gpu.c index d3eb6bde99..e02d500c8f 100644 --- a/test/Driver/openmp-offload-gpu.c +++ b/test/Driver/openmp-offload-gpu.c @@ -73,15 +73,13 @@ /// Check cubin file unbundling and usage by nvlink // RUN: touch %t.o // RUN: %clang -### -target powerpc64le-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \ -// RUN: -no-canonical-prefixes -save-temps %t.o %S/Inputs/in.so 2>&1 \ +// RUN: -no-canonical-prefixes -save-temps %t.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-CUBIN-UNBUNDLING-NVLINK %s /// Use DAG to ensure that cubin file has been unbundled. -// CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so // CHK-CUBIN-UNBUNDLING-NVLINK-DAG: nvlink{{.*}}" {{.*}}"[[CUBIN:.*\.cubin]]" // CHK-CUBIN-UNBUNDLING-NVLINK-DAG: clang-offload-bundler{{.*}}" "-type=o" {{.*}}"-outputs={{.*}}[[CUBIN]] // CHK-CUBIN-UNBUNDLING-NVLINK-DAG-SAME: "-unbundle" -// CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so /// ########################################################################### diff --git a/test/Driver/openmp-offload.c b/test/Driver/openmp-offload.c index d2109df038..af5a527d51 100644 --- a/test/Driver/openmp-offload.c +++ b/test/Driver/openmp-offload.c @@ -358,7 +358,7 @@ /// ########################################################################### /// Check separate compilation with offloading - bundling actions -// RUN: %clang -### -ccc-print-phases -fopenmp=libomp -c -o %t.o %S/Input/in.so -lsomelib -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -no-canonical-prefixes 2>&1 \ +// RUN: %clang -### -ccc-print-phases -fopenmp=libomp -c -o %t.o -lsomelib -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -no-canonical-prefixes 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-BUACTIONS %s // CHK-BUACTIONS: 0: input, "[[INPUT:.+\.c]]", c, (host-openmp) -- 2.50.1