Skip to content

Commit ba16f00

Browse files
committed
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.
1 parent 170b353 commit ba16f00

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
@@ -668,7 +668,6 @@ def __llvm_deoptimize : RuntimeLibcallImpl<DEOPTIMIZE>;
668668

669669
// Clear cache
670670
def __clear_cache : RuntimeLibcallImpl<CLEAR_CACHE>;
671-
def __riscv_flush_icache : RuntimeLibcallImpl<RISCV_FLUSH_ICACHE>;
672671

673672
//--------------------------------------------------------------------
674673
// libm
@@ -928,6 +927,8 @@ def bzero : RuntimeLibcallImpl<BZERO>;
928927
def __bzero : RuntimeLibcallImpl<BZERO>;
929928
def _Unwind_SjLj_Resume : RuntimeLibcallImpl<UNWIND_RESUME>;
930929

930+
def __riscv_flush_icache : RuntimeLibcallImpl<RISCV_FLUSH_ICACHE>;
931+
931932
//===----------------------------------------------------------------------===//
932933
// F128 libm Runtime Libcalls
933934
//===----------------------------------------------------------------------===//
@@ -1844,6 +1845,18 @@ def PPCSystemLibrary
18441845
AvailableIf<memcpy, isNotAIX>,
18451846
LibcallImpls<(add Int128RTLibcalls), isPPC64>)>;
18461847

1848+
//===----------------------------------------------------------------------===//
1849+
// RISCV Runtime Libcalls
1850+
//===----------------------------------------------------------------------===//
1851+
1852+
def isRISCV : RuntimeLibcallPredicate<"TT.isRISCV()">;
1853+
def isRISCV64 : RuntimeLibcallPredicate<"TT.isRISCV64()">;
1854+
1855+
def RISCVSystemLibrary
1856+
: SystemRuntimeLibrary<isRISCV,
1857+
(add DefaultRuntimeLibcallImpls, __riscv_flush_icache,
1858+
LibcallImpls<(add Int128RTLibcalls), isRISCV64>)>;
1859+
18471860
//===----------------------------------------------------------------------===//
18481861
// SPARC Runtime Libcalls
18491862
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)