Skip to content

[SYCL] Integrate the newly-added llvm.tan and llvm.experimental.constrained.tan intrinsics with fp-accuracy. #14193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2024
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
3 changes: 2 additions & 1 deletion clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3014,7 +3014,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
case Builtin::BI__builtin_tanl:
case Builtin::BI__builtin_tanf128:
return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(
*this, E, Intrinsic::tan, Intrinsic::experimental_constrained_tan));
*this, E, Intrinsic::tan, Intrinsic::experimental_constrained_tan,
Intrinsic::fpbuiltin_tan));

case Builtin::BItrunc:
case Builtin::BItruncf:
Expand Down
10 changes: 5 additions & 5 deletions clang/test/CodeGen/fp-accuracy.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void f1(float a, float b) {
// CHECK-F1: call double @llvm.fpbuiltin.tan.f64(double {{.*}}) #[[ATTR_F1_LOW]]
// CHECK-F1: call double @llvm.fpbuiltin.log10.f64(double {{.*}}) #[[ATTR_F1_MEDIUM]]
// CHECK-F1: call void @llvm.fpbuiltin.sincos.f64(double {{.*}}, ptr {{.*}}, ptr {{.*}}) #[[ATTR_F1_MEDIUM]]
// CHECK-F1: call float @tanf(float {{.*}})
// CHECK-F1: call float @llvm.tan.f32(float {{.*}})
// CHECK-F1: call float @hypotf(float {{.*}}, float {{.*}})
// CHECK-F1: call float @ldexpf(float {{.*}}, i32 {{.*}})
//
Expand Down Expand Up @@ -462,7 +462,7 @@ void f1(float a, float b) {
// CHECK-F5: call double @llvm.fpbuiltin.tan.f64(double {{.*}}) #[[ATTR_F5_HIGH]]
// CHECK-F5: call double @llvm.log10.f64(double {{.*}})
// CHECK-F5: call i32 (double, ptr, ptr, ...) @sincos(double {{.*}}, ptr {{.*}}, ptr {{.*}})
// CHECK-F5: call float @tanf(float {{.*}})
// CHECK-F5: call float @llvm.tan.f32(float {{.*}})
// CHECK-F5: call float @hypotf(float {{.*}}, float {{.*}})
// CHECK-F5: call float @ldexpf(float {{.*}}, i32 {{.*}})
//
Expand Down Expand Up @@ -592,16 +592,16 @@ void f1(float a, float b) {
// CHECK-DEFAULT: call i32 (double, ptr, ptr, ...) @sincos(double {{.*}}, ptr {{.*}}, ptr {{.*}})
// CHECK-DEFAULT: call double @sinh(double {{.*}})
// CHECK-DEFAULT: call double @llvm.sqrt.f64(double {{.*}})
// CHECK-DEFAULT: call double @tan(double {{.*}})
// CHECK-DEFAULT: call double @llvm.tan.f64(double {{.*}})
// CHECK-DEFAULT: call double @tanh(double {{.*}})
//
// CHECK-DEFAULT-LABEL: define dso_local void @f2
// CHECK-DEFAULT: call float @llvm.cos.f32(float {{.*}})
// CHECK-DEFAULT: call float @llvm.sin.f32(float {{.*}})
// CHECK-DEFAULT: call double @tan(double {{.*}})
// CHECK-DEFAULT: call double @llvm.tan.f64(double {{.*}})
// CHECK-DEFAULT: call double @llvm.log10.f64(double {{.*}})
// CHECK-DEFAULT: call i32 (double, ptr, ptr, ...) @sincos(double {{.*}}, ptr {{.*}}, ptr {{.*}})
// CHECK-DEFAULT: call float @tanf(float {{.*}})
// CHECK-DEFAULT: call float @llvm.tan.f32(float {{.*}})
// CHECK-DEFAULT: call float @hypotf(float {{.*}}, float {{.*}})
//
// CHECK-DEFAULT-LABEL: define dso_local void @f3
Expand Down