Skip to content

Commit 51f0e21

Browse files
authored
[SYCL] Integrate the newly-added llvm.tan and llvm.experimental.constrained.tan intrinsics with fp-accuracy. (#14193)
This fixes the following LIT tests: * clang/test/CodeGen/fp-accuracy.c * clang/test/CodeGenSYCL/fp-accuracy.cpp * sycl/test/optional_kernel_features/fp-accuracy.c * sycl/test/optional_kernel_features/fp-accuracy.cpp.
1 parent bfd63e6 commit 51f0e21

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2995,7 +2995,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
29952995
case Builtin::BI__builtin_tanl:
29962996
case Builtin::BI__builtin_tanf128:
29972997
return RValue::get(emitUnaryMaybeConstrainedFPBuiltin(
2998-
*this, E, Intrinsic::tan, Intrinsic::experimental_constrained_tan));
2998+
*this, E, Intrinsic::tan, Intrinsic::experimental_constrained_tan,
2999+
Intrinsic::fpbuiltin_tan));
29993000

30003001
case Builtin::BItrunc:
30013002
case Builtin::BItruncf:

clang/test/CodeGen/fp-accuracy.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void f1(float a, float b) {
421421
// CHECK-F1: call double @llvm.fpbuiltin.tan.f64(double {{.*}}) #[[ATTR_F1_LOW]]
422422
// CHECK-F1: call double @llvm.fpbuiltin.log10.f64(double {{.*}}) #[[ATTR_F1_MEDIUM]]
423423
// CHECK-F1: call void @llvm.fpbuiltin.sincos.f64(double {{.*}}, ptr {{.*}}, ptr {{.*}}) #[[ATTR_F1_MEDIUM]]
424-
// CHECK-F1: call float @tanf(float {{.*}})
424+
// CHECK-F1: call float @llvm.tan.f32(float {{.*}})
425425
// CHECK-F1: call float @hypotf(float {{.*}}, float {{.*}})
426426
// CHECK-F1: call float @ldexpf(float {{.*}}, i32 {{.*}})
427427
//
@@ -462,7 +462,7 @@ void f1(float a, float b) {
462462
// CHECK-F5: call double @llvm.fpbuiltin.tan.f64(double {{.*}}) #[[ATTR_F5_HIGH]]
463463
// CHECK-F5: call double @llvm.log10.f64(double {{.*}})
464464
// CHECK-F5: call i32 (double, ptr, ptr, ...) @sincos(double {{.*}}, ptr {{.*}}, ptr {{.*}})
465-
// CHECK-F5: call float @tanf(float {{.*}})
465+
// CHECK-F5: call float @llvm.tan.f32(float {{.*}})
466466
// CHECK-F5: call float @hypotf(float {{.*}}, float {{.*}})
467467
// CHECK-F5: call float @ldexpf(float {{.*}}, i32 {{.*}})
468468
//
@@ -592,16 +592,16 @@ void f1(float a, float b) {
592592
// CHECK-DEFAULT: call i32 (double, ptr, ptr, ...) @sincos(double {{.*}}, ptr {{.*}}, ptr {{.*}})
593593
// CHECK-DEFAULT: call double @sinh(double {{.*}})
594594
// CHECK-DEFAULT: call double @llvm.sqrt.f64(double {{.*}})
595-
// CHECK-DEFAULT: call double @tan(double {{.*}})
595+
// CHECK-DEFAULT: call double @llvm.tan.f64(double {{.*}})
596596
// CHECK-DEFAULT: call double @tanh(double {{.*}})
597597
//
598598
// CHECK-DEFAULT-LABEL: define dso_local void @f2
599599
// CHECK-DEFAULT: call float @llvm.cos.f32(float {{.*}})
600600
// CHECK-DEFAULT: call float @llvm.sin.f32(float {{.*}})
601-
// CHECK-DEFAULT: call double @tan(double {{.*}})
601+
// CHECK-DEFAULT: call double @llvm.tan.f64(double {{.*}})
602602
// CHECK-DEFAULT: call double @llvm.log10.f64(double {{.*}})
603603
// CHECK-DEFAULT: call i32 (double, ptr, ptr, ...) @sincos(double {{.*}}, ptr {{.*}}, ptr {{.*}})
604-
// CHECK-DEFAULT: call float @tanf(float {{.*}})
604+
// CHECK-DEFAULT: call float @llvm.tan.f32(float {{.*}})
605605
// CHECK-DEFAULT: call float @hypotf(float {{.*}}, float {{.*}})
606606
//
607607
// CHECK-DEFAULT-LABEL: define dso_local void @f3

0 commit comments

Comments
 (0)