From b116ee4536caeff8e0b5ef975b206ed669cdf7d2 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Tue, 8 Jul 2025 17:15:58 +0900 Subject: [PATCH] Lanai: Use TableGen to set libcall calling conventions (#146080) --- llvm/include/llvm/IR/RuntimeLibcalls.td | 12 ++++++++++++ llvm/lib/Target/Lanai/LanaiISelLowering.cpp | 4 ---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td index f8667269ec8c..c15ffa065333 100644 --- a/llvm/include/llvm/IR/RuntimeLibcalls.td +++ b/llvm/include/llvm/IR/RuntimeLibcalls.td @@ -1389,6 +1389,18 @@ def __hexagon_fast2_sqrtdf2 : RuntimeLibcallImpl; def __hexagon_memcpy_likely_aligned_min32bytes_mult8bytes : RuntimeLibcallImpl; +//===----------------------------------------------------------------------===// +// Lanai Runtime Libcalls +//===----------------------------------------------------------------------===// + +def isLanai : RuntimeLibcallPredicate<"TT.getArch() == Triple::lanai">; + +// Use fast calling convention for library functions. +def LanaiSystemLibrary + : SystemRuntimeLibrary { + let DefaultLibcallCallingConv = FASTCC; +} + //===----------------------------------------------------------------------===// // Mips16 Runtime Libcalls //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp index 6fb73c5d1896..d23c5f43ad4f 100644 --- a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp +++ b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp @@ -150,10 +150,6 @@ LanaiTargetLowering::LanaiTargetLowering(const TargetMachine &TM, // statements. Re-evaluate this on new benchmarks. setMinimumJumpTableEntries(100); - // Use fast calling convention for library functions. - for (RTLIB::LibcallImpl LC : RTLIB::libcall_impls()) - setLibcallImplCallingConv(LC, CallingConv::Fast); - MaxStoresPerMemset = 16; // For @llvm.memset -> sequence of stores MaxStoresPerMemsetOptSize = 8; MaxStoresPerMemcpy = 16; // For @llvm.memcpy -> sequence of stores