Skip to content

Commit 7f81f86

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 cab40d4 commit 7f81f86

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
//===----------------------------------------------------------------------===//
@@ -1846,6 +1847,18 @@ def PPCSystemLibrary
18461847
AvailableIf<memcpy, isNotAIX>,
18471848
LibcallImpls<(add Int128RTLibcalls), isPPC64>)>;
18481849

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

0 commit comments

Comments
 (0)