From ba16f00404685153f8e220a26435ade3476a1cdd Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Wed, 9 Jul 2025 14:11:25 +0900 Subject: [PATCH] RISCV: Start moving runtime libcall config to tablegen 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. --- llvm/include/llvm/IR/RuntimeLibcalls.td | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td index 28f11e81cb4c8..8e903224b1972 100644 --- a/llvm/include/llvm/IR/RuntimeLibcalls.td +++ b/llvm/include/llvm/IR/RuntimeLibcalls.td @@ -668,7 +668,6 @@ def __llvm_deoptimize : RuntimeLibcallImpl; // Clear cache def __clear_cache : RuntimeLibcallImpl; -def __riscv_flush_icache : RuntimeLibcallImpl; //-------------------------------------------------------------------- // libm @@ -928,6 +927,8 @@ def bzero : RuntimeLibcallImpl; def __bzero : RuntimeLibcallImpl; def _Unwind_SjLj_Resume : RuntimeLibcallImpl; +def __riscv_flush_icache : RuntimeLibcallImpl; + //===----------------------------------------------------------------------===// // F128 libm Runtime Libcalls //===----------------------------------------------------------------------===// @@ -1844,6 +1845,18 @@ def PPCSystemLibrary AvailableIf, LibcallImpls<(add Int128RTLibcalls), isPPC64>)>; +//===----------------------------------------------------------------------===// +// RISCV Runtime Libcalls +//===----------------------------------------------------------------------===// + +def isRISCV : RuntimeLibcallPredicate<"TT.isRISCV()">; +def isRISCV64 : RuntimeLibcallPredicate<"TT.isRISCV64()">; + +def RISCVSystemLibrary + : SystemRuntimeLibrary)>; + //===----------------------------------------------------------------------===// // SPARC Runtime Libcalls //===----------------------------------------------------------------------===//