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.
This commit is contained in:
Matt Arsenault 2025-07-15 18:51:09 +09:00 committed by GitHub
parent 148708493a
commit b2eb7b0701
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2054,6 +2054,17 @@ def SPARCSystemLibrary
LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128)
>;
//===----------------------------------------------------------------------===//
// SPIRV Runtime Libcalls
//===----------------------------------------------------------------------===//
def isSPIRV : RuntimeLibcallPredicate<"TT.isSPIRV()">;
// No calls FIXME: Add memcpy/memset is a hack to skip
// PreISelIntrinsicLowering in favor of SPIRVPrepareFunctions;
// probably should remove that and just use the default one.
def SPIRVSystemLibrary : SystemRuntimeLibrary<isSPIRV, (add memset, memcpy)>;
//===----------------------------------------------------------------------===//
// Windows Runtime Libcalls
//===----------------------------------------------------------------------===//