[llvm-branch-commits] [llvm] RISCV: Start moving runtime libcall config to tablegen (PR #147652)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jul 8 22:22:28 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Matt Arsenault (arsenm)
<details>
<summary>Changes</summary>
This doesn't yet attempt to move the OS dependent configuration
shared with other targets. Removes __riscv_flush_icache from the
default set so it's no longer falsely reported as available for
other targets.
---
Full diff: https://github.com/llvm/llvm-project/pull/147652.diff
1 Files Affected:
- (modified) llvm/include/llvm/IR/RuntimeLibcalls.td (+14-1)
``````````diff
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index ee4892ee186cd..fabfaf89b5aa0 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -668,7 +668,6 @@ def __llvm_deoptimize : RuntimeLibcallImpl<DEOPTIMIZE>;
// Clear cache
def __clear_cache : RuntimeLibcallImpl<CLEAR_CACHE>;
-def __riscv_flush_icache : RuntimeLibcallImpl<RISCV_FLUSH_ICACHE>;
//--------------------------------------------------------------------
// libm
@@ -928,6 +927,8 @@ def bzero : RuntimeLibcallImpl<BZERO>;
def __bzero : RuntimeLibcallImpl<BZERO>;
def _Unwind_SjLj_Resume : RuntimeLibcallImpl<UNWIND_RESUME>;
+def __riscv_flush_icache : RuntimeLibcallImpl<RISCV_FLUSH_ICACHE>;
+
//===----------------------------------------------------------------------===//
// F128 libm Runtime Libcalls
//===----------------------------------------------------------------------===//
@@ -1846,6 +1847,18 @@ def PPCSystemLibrary
AvailableIf<memcpy, isNotAIX>,
LibcallImpls<(add Int128RTLibcalls), isPPC64>)>;
+//===----------------------------------------------------------------------===//
+// RISCV Runtime Libcalls
+//===----------------------------------------------------------------------===//
+
+def isRISCV : RuntimeLibcallPredicate<"TT.isRISCV()">;
+def isRISCV64 : RuntimeLibcallPredicate<"TT.isRISCV64()">;
+
+def RISCVSystemLibrary
+ : SystemRuntimeLibrary<isRISCV,
+ (add DefaultRuntimeLibcallImpls, __riscv_flush_icache,
+ LibcallImpls<(add Int128RTLibcalls), isRISCV64>)>;
+
//===----------------------------------------------------------------------===//
// SPARC Runtime Libcalls
//===----------------------------------------------------------------------===//
``````````
</details>
https://github.com/llvm/llvm-project/pull/147652
More information about the llvm-branch-commits
mailing list