Skip to content

Commit

Permalink
[HIP] clang should pass -mno-amdgpu-ieee to -cc1
Browse files Browse the repository at this point in the history
Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D145721
  • Loading branch information
yxsamliu committed Apr 2, 2023
1 parent 0d61ffd commit 806b74b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang/lib/Driver/ToolChains/Clang.cpp
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions clang/test/Driver/hip-options.hip
Expand Up @@ -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"

0 comments on commit 806b74b

Please sign in to comment.