CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
144 lines
5.8 KiB
TableGen
144 lines
5.8 KiB
TableGen
// RUN: llvm-tblgen -gen-runtime-libcalls -I %p/../../include %s | FileCheck %s
|
|
|
|
include "llvm/IR/RuntimeLibcallsImpl.td"
|
|
|
|
def SDIVREM_I8 : RuntimeLibcall;
|
|
def UDIVREM_I16 : RuntimeLibcall;
|
|
def MALLOC : RuntimeLibcall;
|
|
def TARGET_OVERRIDE_CC : RuntimeLibcall;
|
|
|
|
def __divmodqi4 : RuntimeLibcallImpl<SDIVREM_I8>;
|
|
def __udivmodhi4 : RuntimeLibcallImpl<UDIVREM_I16>;
|
|
|
|
// Test a case where a target wants to set a different calling
|
|
// convention on a generic builtin
|
|
def __target_override_cc : RuntimeLibcallImpl<TARGET_OVERRIDE_CC>;
|
|
|
|
def malloc : RuntimeLibcallImpl<MALLOC>;
|
|
|
|
def isAVR : RuntimeLibcallPredicate<[{TT.getArch() == Triple::avr}]>;
|
|
|
|
def isAVRHurd : RuntimeLibcallPredicate<
|
|
[{TT.getArch() == Triple::avr && TT.isOSHurd()}]>;
|
|
|
|
def AVRLibrary : SystemRuntimeLibrary<isAVR,
|
|
(add malloc, LibcallsWithCC<(add __divmodqi4, __udivmodhi4), AVR_BUILTIN>)
|
|
>;
|
|
|
|
// Test with default calling convention
|
|
def AVRHurdLibrary : SystemRuntimeLibrary<isAVRHurd,
|
|
(add malloc, LibcallsWithCC<(add __divmodqi4, __udivmodhi4), AVR_BUILTIN>)> {
|
|
let DefaultLibcallCallingConv
|
|
= LibcallCallingConv<[{isFoo() ? CallingConv::Fast : CallingConv::GHC}]>;
|
|
}
|
|
|
|
def isMSP430 : RuntimeLibcallPredicate<[{TT.getArch() == Triple::msp430}]>;
|
|
|
|
def MSP430LibraryWithCondCC : SystemRuntimeLibrary<isMSP430,
|
|
(add malloc,
|
|
LibcallsWithCC<(add __divmodqi4), AVR_BUILTIN, RuntimeLibcallPredicate<[{ isFoo() }]>>,
|
|
LibcallsWithCC<(add __udivmodhi4), MSP430_BUILTIN, RuntimeLibcallPredicate<[{ isBar() }]>>)
|
|
>;
|
|
|
|
|
|
// CHECK: void llvm::RTLIB::RuntimeLibcallsInfo::setTargetRuntimeLibcallSets(const llvm::Triple &TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, EABI EABIVersion, StringRef ABIName) {
|
|
// CHECK: if (TT.getArch() == Triple::avr && TT.isOSHurd()) {
|
|
// CHECK-NEXT: const CallingConv::ID DefaultCC = isFoo() ? CallingConv::Fast : CallingConv::GHC;
|
|
// CHECK-NEXT: for (CallingConv::ID &Entry : LibcallImplCallingConvs) {
|
|
// CHECK-NEXT: Entry = DefaultCC;
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: static constexpr LibcallImplBitset SystemAvailableImpls({
|
|
// CHECK-NEXT: 0x0000000000001a
|
|
// CHECK-NEXT: });
|
|
// CHECK-NEXT: AvailableLibcallImpls = SystemAvailableImpls;
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls[] = {
|
|
// CHECK-NEXT: RTLIB::impl_malloc, // malloc
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls_AlwaysAvailable_AVR_BUILTIN[] = {
|
|
// CHECK-NEXT: RTLIB::impl___divmodqi4, // __divmodqi4
|
|
// CHECK-NEXT: RTLIB::impl___udivmodhi4, // __udivmodhi4
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls_AlwaysAvailable_AVR_BUILTIN) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: setLibcallImplCallingConv(Impl, CallingConv::AVR_BUILTIN);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: return;
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: if (TT.getArch() == Triple::avr) {
|
|
// CHECK-NEXT: static constexpr LibcallImplBitset SystemAvailableImpls({
|
|
// CHECK-NEXT: 0x0000000000001a
|
|
// CHECK-NEXT: });
|
|
// CHECK-NEXT: AvailableLibcallImpls = SystemAvailableImpls;
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls[] = {
|
|
// CHECK-NEXT: RTLIB::impl_malloc, // malloc
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls_AlwaysAvailable_AVR_BUILTIN[] = {
|
|
// CHECK-NEXT: RTLIB::impl___divmodqi4, // __divmodqi4
|
|
// CHECK-NEXT: RTLIB::impl___udivmodhi4, // __udivmodhi4
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls_AlwaysAvailable_AVR_BUILTIN) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: setLibcallImplCallingConv(Impl, CallingConv::AVR_BUILTIN);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: return;
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: if (TT.getArch() == Triple::msp430) {
|
|
// CHECK-NEXT: static constexpr LibcallImplBitset SystemAvailableImpls({
|
|
// CHECK-NEXT: 0x00000000000010
|
|
// CHECK-NEXT: });
|
|
// CHECK-NEXT: AvailableLibcallImpls = SystemAvailableImpls;
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls[] = {
|
|
// CHECK-NEXT: RTLIB::impl_malloc, // malloc
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: if ( isFoo() ) {
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls_anonymous_3_AVR_BUILTIN[] = {
|
|
// CHECK-NEXT: RTLIB::impl___divmodqi4, // __divmodqi4
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls_anonymous_3_AVR_BUILTIN) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: setLibcallImplCallingConv(Impl, CallingConv::AVR_BUILTIN);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: if ( isBar() ) {
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls_anonymous_5_MSP430_BUILTIN[] = {
|
|
// CHECK-NEXT: RTLIB::impl___udivmodhi4, // __udivmodhi4
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls_anonymous_5_MSP430_BUILTIN) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: setLibcallImplCallingConv(Impl, CallingConv::MSP430_BUILTIN);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: return;
|
|
// CHECK-NEXT: }
|