diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index c552a415e987d..3aa1cbebe5179 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -3154,9 +3154,10 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, GenerateIntrinsics = ConstWithoutErrnoOrExceptions && ErrnoOverridenToFalseWithOpt; } - if (GenerateIntrinsics && - !(getLangOpts().SYCLIsDevice && (getTarget().getTriple().isNVPTX() || - getTarget().getTriple().isAMDGCN()))) { + bool IsSYCLDeviceWithoutIntrinsics = + getLangOpts().SYCLIsDevice && + (getTarget().getTriple().isNVPTX() || getTarget().getTriple().isAMDGCN()); + if (GenerateIntrinsics && !IsSYCLDeviceWithoutIntrinsics) { switch (BuiltinIDIfNoAsmLabel) { case Builtin::BIacos: case Builtin::BIacosf: @@ -4256,7 +4257,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, case Builtin::BI__builtin_modf: case Builtin::BI__builtin_modff: case Builtin::BI__builtin_modfl: - if (Builder.getIsFPConstrained()) + if (Builder.getIsFPConstrained() || IsSYCLDeviceWithoutIntrinsics) break; // TODO: Emit constrained modf intrinsic once one exists. return RValue::get(emitModfBuiltin(*this, E, Intrinsic::modf)); case Builtin::BI__builtin_isgreater: diff --git a/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp b/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp index 70f8d87f4e727..bfb23b70a3c4f 100644 --- a/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp @@ -1,4 +1,4 @@ -// UNSUPPORTED: true +// UNSUPPORTED: spirv-backend // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17813 // REQUIRES: aspect-fp64 // UNSUPPORTED: target-amd || target-nvidia diff --git a/sycl/test-e2e/DeviceLib/cmath_test.cpp b/sycl/test-e2e/DeviceLib/cmath_test.cpp index de46dc386734c..f5e3220ae0be3 100644 --- a/sycl/test-e2e/DeviceLib/cmath_test.cpp +++ b/sycl/test-e2e/DeviceLib/cmath_test.cpp @@ -1,4 +1,4 @@ -// UNSUPPORTED: true +// UNSUPPORTED: spirv-backend // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17813 // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} diff --git a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp index 823bba9d513e7..1a52b322775ad 100644 --- a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp @@ -1,4 +1,4 @@ -// UNSUPPORTED: true +// UNSUPPORTED: spirv-backend // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17813 // REQUIRES: aspect-fp64 diff --git a/sycl/test-e2e/DeviceLib/math_test.cpp b/sycl/test-e2e/DeviceLib/math_test.cpp index f2fc2b3ebc187..3ddcee36a9b5e 100644 --- a/sycl/test-e2e/DeviceLib/math_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_test.cpp @@ -1,4 +1,4 @@ -// UNSUPPORTED: true +// UNSUPPORTED: spirv-backend // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17813 // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}