Index: lib/Analysis/TargetLibraryInfo.cpp =================================================================== --- lib/Analysis/TargetLibraryInfo.cpp +++ lib/Analysis/TargetLibraryInfo.cpp @@ -397,24 +397,18 @@ TLI.setUnavailable(LibFunc_flsll); } - // Android uses bionic instead of glibc. So disable some finite - // lib calls in glibc for Android. The list of unsupported lib - // calls for Android may expand as the need arises. - if (T.isAndroid()) { - TLI.setUnavailable(LibFunc_exp_finite); - TLI.setUnavailable(LibFunc_exp2_finite); - TLI.setUnavailable(LibFunc_pow_finite); - } - - // The following functions are available on at least Linux: - if (!T.isOSLinux()) { + // The following functions are available on Linux, + // but Android uses bionic instead of glibc. + if (!T.isOSLinux() || T.isAndroid()) { TLI.setUnavailable(LibFunc_dunder_strdup); TLI.setUnavailable(LibFunc_dunder_strtok_r); TLI.setUnavailable(LibFunc_dunder_isoc99_scanf); TLI.setUnavailable(LibFunc_dunder_isoc99_sscanf); TLI.setUnavailable(LibFunc_under_IO_getc); TLI.setUnavailable(LibFunc_under_IO_putc); - TLI.setUnavailable(LibFunc_memalign); + // Android has memalign. + if (!T.isOSLinux()) + TLI.setUnavailable(LibFunc_memalign); TLI.setUnavailable(LibFunc_fopen64); TLI.setUnavailable(LibFunc_fseeko64); TLI.setUnavailable(LibFunc_fstat64); Index: test/CodeGen/AArch64/illegal-float-ops.ll =================================================================== --- test/CodeGen/AArch64/illegal-float-ops.ll +++ test/CodeGen/AArch64/illegal-float-ops.ll @@ -265,6 +265,30 @@ ret void } +define void @test_log_finite(double %double) #0 { + %logdouble = call double @llvm.log.f64(double %double) + store double %logdouble, double* @vardouble + ; ANDROID-AARCH64-NOT: bl __log_finite + ; CHECK: bl __log_finite + ret void +} + +define void @test_log2_finite(double %double) #0 { + %log2double = call double @llvm.log2.f64(double %double) + store double %log2double, double* @vardouble + ; ANDROID-AARCH64-NOT: bl __log2_finite + ; CHECK: bl __log2_finite + ret void +} + +define void @test_log10_finite(double %double) #0 { + %log10double = call double @llvm.log10.f64(double %double) + store double %log10double, double* @vardouble + ; ANDROID-AARCH64-NOT: bl __log10_finite + ; CHECK: bl __log10_finite + ret void +} + define void @test_pow_finite(double %double) #0 { %powdouble = call double @llvm.pow.f64(double %double, double %double) store double %powdouble, double* @vardouble