[llvm] d92e6f0 - RISCV: Start moving runtime libcall config to tablegen (#147652)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 12 18:51:13 PDT 2025


Author: Matt Arsenault
Date: 2025-07-13T10:51:10+09:00
New Revision: d92e6f0e81a4699c205d5cf023d9daeac1118cc5

URL: https://github.com/llvm/llvm-project/commit/d92e6f0e81a4699c205d5cf023d9daeac1118cc5
DIFF: https://github.com/llvm/llvm-project/commit/d92e6f0e81a4699c205d5cf023d9daeac1118cc5.diff

LOG: RISCV: Start moving runtime libcall config to tablegen (#147652)

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.

Added: 
    

Modified: 
    llvm/include/llvm/IR/RuntimeLibcalls.td

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index ebea7ec533c32..9a8dd66b7a1ad 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -696,7 +696,6 @@ def __llvm_deoptimize : RuntimeLibcallImpl<DEOPTIMIZE>;
 
 // Clear cache
 def __clear_cache : RuntimeLibcallImpl<CLEAR_CACHE>;
-def __riscv_flush_icache : RuntimeLibcallImpl<RISCV_FLUSH_ICACHE>;
 
 //--------------------------------------------------------------------
 // libm
@@ -956,6 +955,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
 //===----------------------------------------------------------------------===//
@@ -1903,6 +1904,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
 //===----------------------------------------------------------------------===//


        


More information about the llvm-commits mailing list