forked from OSchip/llvm-project
ARM64: don't generate __sincos_stret calls unless on MachO
This should fix PR19314. llvm-svn: 205514
This commit is contained in:
parent
f51ee3c416
commit
c7c6a93704
|
@ -351,11 +351,16 @@ ARM64TargetLowering::ARM64TargetLowering(ARM64TargetMachine &TM)
|
||||||
|
|
||||||
setOperationAction(ISD::PREFETCH, MVT::Other, Custom);
|
setOperationAction(ISD::PREFETCH, MVT::Other, Custom);
|
||||||
|
|
||||||
// For iOS, we don't want to the normal expansion of a libcall to
|
if (Subtarget->isTargetMachO()) {
|
||||||
// sincos. We want to issue a libcall to __sincos_stret to avoid memory
|
// For iOS, we don't want to the normal expansion of a libcall to
|
||||||
// traffic.
|
// sincos. We want to issue a libcall to __sincos_stret to avoid memory
|
||||||
setOperationAction(ISD::FSINCOS, MVT::f64, Custom);
|
// traffic.
|
||||||
setOperationAction(ISD::FSINCOS, MVT::f32, Custom);
|
setOperationAction(ISD::FSINCOS, MVT::f64, Custom);
|
||||||
|
setOperationAction(ISD::FSINCOS, MVT::f32, Custom);
|
||||||
|
} else {
|
||||||
|
setOperationAction(ISD::FSINCOS, MVT::f64, Expand);
|
||||||
|
setOperationAction(ISD::FSINCOS, MVT::f32, Expand);
|
||||||
|
}
|
||||||
|
|
||||||
// ARM64 does not have floating-point extending loads, i1 sign-extending load,
|
// ARM64 does not have floating-point extending loads, i1 sign-extending load,
|
||||||
// floating-point truncating stores, or v2i32->v2i16 truncating store.
|
// floating-point truncating stores, or v2i32->v2i16 truncating store.
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
; RUN: llc < %s -mtriple=arm64-apple-ios7 | FileCheck %s
|
; RUN: llc < %s -mtriple=arm64-apple-ios7 | FileCheck %s --check-prefix CHECK-IOS
|
||||||
|
; RUN: llc < %s -mtriple=arm64-linux-gnu | FileCheck %s --check-prefix CHECK-LINUX
|
||||||
|
|
||||||
; Combine sin / cos into a single call.
|
; Combine sin / cos into a single call.
|
||||||
; rdar://12856873
|
; rdar://12856873
|
||||||
|
|
||||||
define float @test1(float %x) nounwind {
|
define float @test1(float %x) nounwind {
|
||||||
entry:
|
entry:
|
||||||
; CHECK-LABEL: test1:
|
; CHECK-IOS-LABEL: test1:
|
||||||
; CHECK: bl ___sincosf_stret
|
; CHECK-IOS: bl ___sincosf_stret
|
||||||
; CHECK: fadd s0, s0, s1
|
; CHECK-IOS: fadd s0, s0, s1
|
||||||
|
|
||||||
|
; CHECK-LINUX-LABEL: test1:
|
||||||
|
; CHECK-LINUX: bl sinf
|
||||||
|
; CHECK-LINUX: bl cosf
|
||||||
|
|
||||||
%call = tail call float @sinf(float %x) nounwind readnone
|
%call = tail call float @sinf(float %x) nounwind readnone
|
||||||
%call1 = tail call float @cosf(float %x) nounwind readnone
|
%call1 = tail call float @cosf(float %x) nounwind readnone
|
||||||
%add = fadd float %call, %call1
|
%add = fadd float %call, %call1
|
||||||
|
@ -16,9 +22,14 @@ entry:
|
||||||
|
|
||||||
define double @test2(double %x) nounwind {
|
define double @test2(double %x) nounwind {
|
||||||
entry:
|
entry:
|
||||||
; CHECK-LABEL: test2:
|
; CHECK-IOS-LABEL: test2:
|
||||||
; CHECK: bl ___sincos_stret
|
; CHECK-IOS: bl ___sincos_stret
|
||||||
; CHECK: fadd d0, d0, d1
|
; CHECK-IOS: fadd d0, d0, d1
|
||||||
|
|
||||||
|
; CHECK-LINUX-LABEL: test2:
|
||||||
|
; CHECK-LINUX: bl sin
|
||||||
|
; CHECK-LINUX: bl cos
|
||||||
|
|
||||||
%call = tail call double @sin(double %x) nounwind readnone
|
%call = tail call double @sin(double %x) nounwind readnone
|
||||||
%call1 = tail call double @cos(double %x) nounwind readnone
|
%call1 = tail call double @cos(double %x) nounwind readnone
|
||||||
%add = fadd double %call, %call1
|
%add = fadd double %call, %call1
|
||||||
|
|
Loading…
Reference in New Issue