RISCV: Start moving runtime libcall config to tablegen#147652
Merged
Conversation
This was referenced Jul 9, 2025
Contributor
Author
This was referenced Jul 9, 2025
Member
|
@llvm/pr-subscribers-llvm-selectiondag @llvm/pr-subscribers-llvm-ir Author: Matt Arsenault (arsenm) ChangesThis doesn't yet attempt to move the OS dependent configuration Full diff: https://github.com/llvm/llvm-project/pull/147652.diff 1 Files Affected:
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
//===----------------------------------------------------------------------===//
|
This was referenced Jul 9, 2025
cab40d4 to
170b353
Compare
7f81f86 to
ba16f00
Compare
170b353 to
652b9c5
Compare
ba16f00 to
f4304a2
Compare
Contributor
Author
652b9c5 to
cf3a31e
Compare
Base automatically changed from
users/arsenm/runtime-libcalls/stop-using-defset-default-libcall-impls
to
main
July 13, 2025 01:47
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.
f4304a2 to
c9c599f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.