[llvm-branch-commits] [llvm] Lanai: Use TableGen to set libcall calling conventions (PR #146080)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jun 27 07:22:19 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Matt Arsenault (arsenm)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/146080.diff
2 Files Affected:
- (modified) llvm/include/llvm/IR/RuntimeLibcalls.td (+12)
- (modified) llvm/lib/Target/Lanai/LanaiISelLowering.cpp (-4)
``````````diff
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 59e9481201de4..396dc45240412 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -1360,6 +1360,18 @@ def __hexagon_fast2_sqrtdf2 : RuntimeLibcallImpl<SQRT_F64>;
def __hexagon_memcpy_likely_aligned_min32bytes_mult8bytes
: RuntimeLibcallImpl<HEXAGON_MEMCPY_LIKELY_ALIGNED_MIN32BYTES_MULT8BYTES>;
+//===----------------------------------------------------------------------===//
+// Lanai Runtime Libcalls
+//===----------------------------------------------------------------------===//
+
+def isLanai : RuntimeLibcallPredicate<"TT.getArch() == Triple::lanai">;
+
+// Use fast calling convention for library functions.
+def LanaiSystemLibrary
+ : SystemRuntimeLibrary<isLanai, (add DefaultRuntimeLibcallImpls)> {
+ let DefaultLibcallCallingConv = FASTCC;
+}
+
//===----------------------------------------------------------------------===//
// Mips16 Runtime Libcalls
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp
index ec668ebaeab0d..272c7bc1a8db6 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
``````````
</details>
https://github.com/llvm/llvm-project/pull/146080
More information about the llvm-branch-commits
mailing list