Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceLib/cmath_test.cpp
Original file line number Diff line number Diff line change
@@ -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%}

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceLib/math_fp64_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// UNSUPPORTED: true
// UNSUPPORTED: spirv-backend
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17813
// REQUIRES: aspect-fp64

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceLib/math_test.cpp
Original file line number Diff line number Diff line change
@@ -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%}

Expand Down