Author: Joseph Huber Date: 2022-02-03T17:17:38-05:00 New Revision: 9138d96f8b01605b213e8c4d587853a46cca3f44
URL: https://github.com/llvm/llvm-project/commit/9138d96f8b01605b213e8c4d587853a46cca3f44 DIFF: https://github.com/llvm/llvm-project/commit/9138d96f8b01605b213e8c4d587853a46cca3f44.diff LOG: [OpenMP] Don't use bound architecture when checking cache on the host When we are creating jobs for the new driver we first check the cache to see if the job was already created as a part of the offloading toolchain. This would sometimes fail if the bound architecture was set for the host during offloading. We want to ingore this because it is not relevant for looking up host actions. Previously it was set on some machines and would cause the cache lookup to fail. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D118858 Added: Modified: clang/lib/Driver/Driver.cpp clang/test/Driver/openmp-offload-gpu.c Removed: ################################################################################ diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 3bfddeefc7b2b..18dc6561b4d49 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -4828,9 +4828,11 @@ InputInfoList Driver::BuildJobsForActionNoCache( // We may have already built this action as a part of the offloading // toolchain, return the cached input if so. + StringRef Arch = + (TargetDeviceOffloadKind == Action::OFK_Host) ? StringRef() : BoundArch; std::pair<const Action *, std::string> ActionTC = { OA->getHostDependence(), - GetTriplePlusArchString(TC, BoundArch, TargetDeviceOffloadKind)}; + GetTriplePlusArchString(TC, Arch, TargetDeviceOffloadKind)}; if (CachedResults.find(ActionTC) != CachedResults.end()) { InputInfoList Inputs = CachedResults[ActionTC]; Inputs.append(OffloadDependencesInputInfo); diff --git a/clang/test/Driver/openmp-offload-gpu.c b/clang/test/Driver/openmp-offload-gpu.c index af7ba7c802e5d..a9fc3e7b33a42 100644 --- a/clang/test/Driver/openmp-offload-gpu.c +++ b/clang/test/Driver/openmp-offload-gpu.c @@ -358,6 +358,8 @@ // NEW_DRIVER: "[[HOST_TRIPLE:.+]]" - "clang", inputs: ["[[HOST_INPUT:.+]]"], output: "[[HOST_BC:.+]]" // NEW_DRIVER: "nvptx64-nvidia-cuda" - "clang", inputs: ["[[DEVICE_INPUT:.+]]", "[[HOST_BC]]"], output: "[[DEVICE_ASM:.+]]" // NEW_DRIVER: "nvptx64-nvidia-cuda" - "NVPTX::Assembler", inputs: ["[[DEVICE_ASM]]"], output: "[[DEVICE_OBJ:.+]]" +// NEW_DRIVER: "[[HOST_TRIPLE:.+]]" - "clang", inputs: ["[[HOST_BC]]", "[[DEVICE_OBJ]]"], output: "[[HOST_OBJ:.+]]" +// NEW_DRIVER: "[[HOST_TRIPLE:.+]]" - "[[LINKER:.+]]", inputs: ["[[HOST_OBJ]]"], output: "openmp-offload-gpu" // RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target=nvptx64-nvida-cuda -march=sm_70 \ // RUN: --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget/libomptarget-new-nvptx-test.bc \ _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits