Skip to content

Commit d92e6f0

Browse files
authored
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.
1 parent 77bcde6 commit d92e6f0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,6 @@ def __llvm_deoptimize : RuntimeLibcallImpl<DEOPTIMIZE>;
696696

697697
// Clear cache
698698
def __clear_cache : RuntimeLibcallImpl<CLEAR_CACHE>;
699-
def __riscv_flush_icache : RuntimeLibcallImpl<RISCV_FLUSH_ICACHE>;
700699

701700
//--------------------------------------------------------------------
702701
// libm
@@ -956,6 +955,8 @@ def bzero : RuntimeLibcallImpl<BZERO>;
956955
def __bzero : RuntimeLibcallImpl<BZERO>;
957956
def _Unwind_SjLj_Resume : RuntimeLibcallImpl<UNWIND_RESUME>;
958957

958+
def __riscv_flush_icache : RuntimeLibcallImpl<RISCV_FLUSH_ICACHE>;
959+
959960
//===----------------------------------------------------------------------===//
960961
// F128 libm Runtime Libcalls
961962
//===----------------------------------------------------------------------===//
@@ -1903,6 +1904,18 @@ def PPCSystemLibrary
19031904
AvailableIf<memcpy, isNotAIX>,
19041905
LibcallImpls<(add Int128RTLibcalls), isPPC64>)>;
19051906

1907+
//===----------------------------------------------------------------------===//
1908+
// RISCV Runtime Libcalls
1909+
//===----------------------------------------------------------------------===//
1910+
1911+
def isRISCV : RuntimeLibcallPredicate<"TT.isRISCV()">;
1912+
def isRISCV64 : RuntimeLibcallPredicate<"TT.isRISCV64()">;
1913+
1914+
def RISCVSystemLibrary
1915+
: SystemRuntimeLibrary<isRISCV,
1916+
(add DefaultRuntimeLibcallImpls, __riscv_flush_icache,
1917+
LibcallImpls<(add Int128RTLibcalls), isRISCV64>)>;
1918+
19061919
//===----------------------------------------------------------------------===//
19071920
// SPARC Runtime Libcalls
19081921
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)