Skip to content

Commit cb46afc

Browse files
committed
AArch64: Darwin has bzero
1 parent cbf2553 commit cb46afc

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ include "llvm/IR/RuntimeLibcallsImpl.td"
1515
class DuplicateLibcallImplWithPrefix<RuntimeLibcallImpl Impl, string prefix>
1616
: RuntimeLibcallImpl<Impl.Provides, prefix#Impl.LibCallFuncName>;
1717

18+
/// Libcall Predicates
19+
def isOSDarwin : RuntimeLibcallPredicate<"TT.isOSDarwin()">;
20+
21+
def darwinHasSinCosStret : RuntimeLibcallPredicate<"darwinHasSinCosStret(TT)">;
22+
def darwinHasExp10 : RuntimeLibcallPredicate<"darwinHasExp10(TT)">;
23+
def hasSinCos : RuntimeLibcallPredicate<"hasSinCos(TT)">;
24+
1825
//--------------------------------------------------------------------
1926
// Declare all kinds of used libcalls
2027
//--------------------------------------------------------------------
@@ -1046,7 +1053,8 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
10461053
isAArch64_ExceptArm64EC,
10471054
(add DefaultRuntimeLibcallImpls,
10481055
AArch64LibcallImpls,
1049-
LibcallImpls<(add LibCallsCompilerRT64OrLibGCC), isAArch64_ILP64>)
1056+
LibcallImpls<(add LibCallsCompilerRT64OrLibGCC), isAArch64_ILP64>,
1057+
LibcallImpls<(add bzero), isOSDarwin>)
10501058
>;
10511059

10521060
// Prepend a # to every name

llvm/lib/IR/RuntimeLibcalls.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
346346
if (TT.isX86()) {
347347
if (TT.isMacOSX() && !TT.isMacOSXVersionLT(10, 6))
348348
setLibcallImpl(RTLIB::BZERO, RTLIB::__bzero);
349-
} else if (TT.isAArch64())
350-
setLibcallImpl(RTLIB::BZERO, RTLIB::bzero);
349+
}
351350

352351
if (darwinHasSinCosStret(TT)) {
353352
setLibcallImpl(RTLIB::SINCOS_STRET_F32, RTLIB::__sincosf_stret);

0 commit comments

Comments
 (0)