https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/145639
Write this in a more predicate-apply style instead of the switch. >From 2fdd40315244cf87324ec124e232549b5c611e92 Mon Sep 17 00:00:00 2001 From: Matt Arsenault <matthew.arsena...@amd.com> Date: Wed, 25 Jun 2025 14:42:24 +0900 Subject: [PATCH] RuntimeLibcalls: Cleanup darwin bzero configuration Write this in a more predicate-apply style instead of the switch. --- llvm/lib/IR/RuntimeLibcalls.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp index cb8c8457f5a47..5c01d8595d0f9 100644 --- a/llvm/lib/IR/RuntimeLibcalls.cpp +++ b/llvm/lib/IR/RuntimeLibcalls.cpp @@ -432,19 +432,11 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT, setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2"); // Some darwins have an optimized __bzero/bzero function. - switch (TT.getArch()) { - case Triple::x86: - case Triple::x86_64: + if (TT.isX86()) { if (TT.isMacOSX() && !TT.isMacOSXVersionLT(10, 6)) setLibcallName(RTLIB::BZERO, "__bzero"); - break; - case Triple::aarch64: - case Triple::aarch64_32: + } else if (TT.isAArch64()) setLibcallName(RTLIB::BZERO, "bzero"); - break; - default: - break; - } if (darwinHasSinCosStret(TT)) { setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret"); _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits