Skip to content

Commit b2eb7b0

Browse files
authored
SPIRV: Define runtime libcalls to be (almost) empty (#148631)
This is a behavior change; previously SPIRV inherited a default set of calls which seems like a mistake. This defines a library set with no calls. Add memcpy and memset as a hack; this avoids PreISelIntrinsicLowering performing the default expansion. SPIRVPrepareFunctions also calls the utilities to expand these but the resulting output is slightly different. The backend specific version can probably be removed, it for some reason has a larger output than the default one.
1 parent 1487084 commit b2eb7b0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,6 +2054,17 @@ def SPARCSystemLibrary
20542054
LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128)
20552055
>;
20562056

2057+
//===----------------------------------------------------------------------===//
2058+
// SPIRV Runtime Libcalls
2059+
//===----------------------------------------------------------------------===//
2060+
2061+
def isSPIRV : RuntimeLibcallPredicate<"TT.isSPIRV()">;
2062+
2063+
// No calls FIXME: Add memcpy/memset is a hack to skip
2064+
// PreISelIntrinsicLowering in favor of SPIRVPrepareFunctions;
2065+
// probably should remove that and just use the default one.
2066+
def SPIRVSystemLibrary : SystemRuntimeLibrary<isSPIRV, (add memset, memcpy)>;
2067+
20572068
//===----------------------------------------------------------------------===//
20582069
// Windows Runtime Libcalls
20592070
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)