Index: llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp =================================================================== --- llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp +++ llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp @@ -161,7 +161,8 @@ setLibcallName(RTLIB::FPROUND_F32_F16, "__gnu_f2h_ieee"); } - if (TT.isGNUEnvironment() || TT.isOSFuchsia()) { + if (TT.isGNUEnvironment() || TT.isOSFuchsia() || + (TT.isAndroid() && !TT.isAndroidVersionLT(9))) { setLibcallName(RTLIB::SINCOS_F32, "sincosf"); setLibcallName(RTLIB::SINCOS_F64, "sincos"); setLibcallName(RTLIB::SINCOS_F80, "sincosl"); Index: llvm/trunk/test/CodeGen/AArch64/arm64-sincos.ll =================================================================== --- llvm/trunk/test/CodeGen/AArch64/arm64-sincos.ll +++ llvm/trunk/test/CodeGen/AArch64/arm64-sincos.ll @@ -1,5 +1,6 @@ ; 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 +; RUN: llc < %s -mtriple=arm64-linux-android | FileCheck %s --check-prefix CHECK-LINUX ; Combine sin / cos into a single call unless they may write errno (as ; captured by readnone attrbiute, controlled by clang -fmath-errno Index: llvm/trunk/test/CodeGen/ARM/sincos.ll =================================================================== --- llvm/trunk/test/CodeGen/ARM/sincos.ll +++ llvm/trunk/test/CodeGen/ARM/sincos.ll @@ -3,6 +3,8 @@ ; RUN: llc < %s -mtriple=armv7-linux-gnu -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS-GNU ; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a8 \ ; RUN: --enable-unsafe-fp-math | FileCheck %s --check-prefix=SINCOS-GNU +; RUN: llc < %s -mtriple=armv7-linux-android -mcpu=cortex-a8 | FileCheck %s --check-prefix=NOOPT-ANDROID +; RUN: llc < %s -mtriple=armv7-linux-android9 -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS-GNU ; Combine sin / cos into a single call unless they may write errno (as ; captured by readnone attrbiute, controlled by clang -fmath-errno @@ -21,6 +23,10 @@ ; NOOPT: bl _sinf ; NOOPT: bl _cosf +; NOOPT-ANDROID-LABEL: test1: +; NOOPT-ANDROID: bl sinf +; NOOPT-ANDROID: bl cosf + %call = tail call float @sinf(float %x) readnone %call1 = tail call float @cosf(float %x) readnone %add = fadd float %call, %call1 @@ -41,6 +47,10 @@ ; NOOPT: bl _sinf ; NOOPT: bl _cosf +; NOOPT-ANDROID-LABEL: test1_errno: +; NOOPT-ANDROID: bl sinf +; NOOPT-ANDROID: bl cosf + %call = tail call float @sinf(float %x) %call1 = tail call float @cosf(float %x) %add = fadd float %call, %call1 @@ -59,6 +69,10 @@ ; NOOPT: bl _sin ; NOOPT: bl _cos +; NOOPT-ANDROID-LABEL: test2: +; NOOPT-ANDROID: bl sin +; NOOPT-ANDROID: bl cos + %call = tail call double @sin(double %x) readnone %call1 = tail call double @cos(double %x) readnone %add = fadd double %call, %call1 @@ -79,6 +93,10 @@ ; NOOPT: bl _sin ; NOOPT: bl _cos +; NOOPT-ANDROID-LABEL: test2_errno: +; NOOPT-ANDROID: bl sin +; NOOPT-ANDROID: bl cos + %call = tail call double @sin(double %x) %call1 = tail call double @cos(double %x) %add = fadd double %call, %call1