[clang] 806b74b - [HIP] clang should pass `-mno-amdgpu-ieee` to -cc1
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 2 05:45:51 PDT 2023
Author: Yaxun (Sam) Liu
Date: 2023-04-02T08:11:17-04:00
New Revision: 806b74b0de6e7354033ec36c833d43ca8ff13fa7
URL: https://github.com/llvm/llvm-project/commit/806b74b0de6e7354033ec36c833d43ca8ff13fa7
DIFF: https://github.com/llvm/llvm-project/commit/806b74b0de6e7354033ec36c833d43ca8ff13fa7.diff
LOG: [HIP] clang should pass `-mno-amdgpu-ieee` to -cc1
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D145721
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/hip-options.hip
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 1984e1393a15c..41fe89337d1b1 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -7146,6 +7146,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.addOptInFlag(CmdArgs, options::OPT_munsafe_fp_atomics,
options::OPT_mno_unsafe_fp_atomics);
+ Args.addOptOutFlag(CmdArgs, options::OPT_mamdgpu_ieee,
+ options::OPT_mno_amdgpu_ieee);
}
// For all the host OpenMP offloading compile jobs we need to pass the targets
diff --git a/clang/test/Driver/hip-options.hip b/clang/test/Driver/hip-options.hip
index 97d0c1370bc42..0bce2ace10a49 100644
--- a/clang/test/Driver/hip-options.hip
+++ b/clang/test/Driver/hip-options.hip
@@ -126,3 +126,15 @@
// RUN: --offload-arch=gfx906 %s 2>&1 \
// RUN: | FileCheck -check-prefix=KANNEG %s
// KANNEG-NOT: "-fhip-kernel-arg-name"
+
+// RUN: %clang -### -nogpuinc -nogpulib -mno-amdgpu-ieee -mamdgpu-ieee \
+// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=IEEE-ON %s
+// IEEE-ON-NOT: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-m{{(no-)?}}amdgpu-ieee"
+
+// RUN: %clang -### -nogpuinc -nogpulib -mamdgpu-ieee -mno-amdgpu-ieee -ffast-math \
+// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefixes=IEEE-OFF %s
+// IEEE-OFF: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mno-amdgpu-ieee"
+
+// RUN: %clang -### -nogpuinc -nogpulib -mamdgpu-ieee -mno-amdgpu-ieee -ffast-math \
+// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefixes=IEEE-OFF-NEG %s
+// IEEE-OFF-NEG-NOT: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-mamdgpu-ieee"
More information about the cfe-commits
mailing list