Skip to content

Commit 52d9de9

Browse files
author
Martin Wehking
committed
Fix intrinsic selection for AMD
Do not select builtin LLVM intrinsics for AMDGCN by default. Previously, these intrinsics were selected by default and prevented linkage of standard library math functions provided by libdevice.
1 parent a8f2cb8 commit 52d9de9

File tree

4 files changed

+2
-5
lines changed

4 files changed

+2
-5
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2719,7 +2719,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
27192719
ConstWithoutErrnoOrExceptions && ErrnoOverridenToFalseWithOpt;
27202720
}
27212721
if (GenerateIntrinsics &&
2722-
!(getLangOpts().SYCLIsDevice && getTarget().getTriple().isNVPTX())) {
2722+
!(getLangOpts().SYCLIsDevice && (getTarget().getTriple().isNVPTX() ||
2723+
getTarget().getTriple().isAMDGCN()))) {
27232724
switch (BuiltinIDIfNoAsmLabel) {
27242725
case Builtin::BIceil:
27252726
case Builtin::BIceilf:

sycl/test-e2e/DeviceLib/cmath_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
22

3-
// UNSUPPORTED: hip
43
// RUN: %{build} -fno-builtin %{mathflags} -o %t.out
54
// RUN: %{run} %t.out
65

sycl/test-e2e/DeviceLib/math_fp64_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// REQUIRES: aspect-fp64
2-
// UNSUPPORTED: hip
32

43
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
54

sycl/test-e2e/DeviceLib/math_test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// UNSUPPORTED: hip
2-
31
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
42

53
// RUN: %{build} %{mathflags} -o %t.out

0 commit comments

Comments
 (0)