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
98 lines
3.6 KiB
TableGen
98 lines
3.6 KiB
TableGen
// RUN: llvm-tblgen -gen-runtime-libcalls -I %p/../../include %s 2> %t.err | FileCheck %s
|
|
// RUN: FileCheck -check-prefix=ERR %s < %t.err
|
|
|
|
// Check behavior of libcall emission when multiple RuntimeLibcallImpl
|
|
// implementations provide the same RuntimeLibcall
|
|
|
|
include "llvm/IR/RuntimeLibcallsImpl.td"
|
|
|
|
def SOME_FUNC : RuntimeLibcall;
|
|
def OTHER_FUNC : RuntimeLibcall;
|
|
def ANOTHER_DUP : RuntimeLibcall;
|
|
|
|
def isTargetArchA : RuntimeLibcallPredicate<[{isTargetArchA()}]>;
|
|
def isTargetArchB : RuntimeLibcallPredicate<[{isTargetArchB()}]>;
|
|
def isTargetArchC : RuntimeLibcallPredicate<[{isTargetArchC()}]>;
|
|
|
|
def func_a : RuntimeLibcallImpl<SOME_FUNC>;
|
|
def func_b : RuntimeLibcallImpl<SOME_FUNC>;
|
|
def func_c : RuntimeLibcallImpl<SOME_FUNC>;
|
|
def other_func : RuntimeLibcallImpl<OTHER_FUNC>;
|
|
|
|
def dup0 : RuntimeLibcallImpl<ANOTHER_DUP>;
|
|
def dup1 : RuntimeLibcallImpl<ANOTHER_DUP>;
|
|
|
|
// func_a and func_b both provide SOME_FUNC.
|
|
|
|
// CHECK: if (isTargetArchA()) {
|
|
// CHECK-NEXT: static constexpr LibcallImplBitset SystemAvailableImpls({
|
|
// CHECK-NEXT: 0x00000000000018
|
|
// CHECK-NEXT: });
|
|
// CHECK-NEXT: AvailableLibcallImpls = SystemAvailableImpls;
|
|
// CHECK-EMPTY:
|
|
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls[] = {
|
|
// CHECK-NEXT: RTLIB::impl_func_b, // func_b
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: return;
|
|
// CHECK-NEXT: }
|
|
|
|
// ERR: :[[@LINE+1]]:5: warning: conflicting implementations for libcall SOME_FUNC: func_b, func_a
|
|
def TheSystemLibraryA : SystemRuntimeLibrary<isTargetArchA,
|
|
(add func_b, func_a)
|
|
>;
|
|
|
|
// CHECK: if (isTargetArchB()) {
|
|
// CHECK-NEXT: static constexpr LibcallImplBitset SystemAvailableImpls({
|
|
// CHECK-NEXT: 0x00000000000058
|
|
// CHECK-NEXT: });
|
|
// CHECK-NEXT: AvailableLibcallImpls = SystemAvailableImpls;
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls[] = {
|
|
// CHECK-NEXT: RTLIB::impl_other_func, // other_func
|
|
// CHECK-NEXT: RTLIB::impl_func_a, // func_a
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: return;
|
|
// CHECK-NEXT: }
|
|
|
|
// ERR: :[[@LINE+1]]:5: warning: conflicting implementations for libcall SOME_FUNC: func_a, func_b
|
|
def TheSystemLibraryB : SystemRuntimeLibrary<isTargetArchB,
|
|
(add func_a, other_func, func_b)
|
|
>;
|
|
|
|
// CHECK: if (isTargetArchC()) {
|
|
// CHECK-NEXT: static constexpr LibcallImplBitset SystemAvailableImpls({
|
|
// CHECK-NEXT: 0x0000000000007e
|
|
// CHECK-NEXT: });
|
|
// CHECK-NEXT: AvailableLibcallImpls = SystemAvailableImpls;
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: static const RTLIB::LibcallImpl LibraryCalls[] = {
|
|
// CHECK-NEXT: RTLIB::impl_dup1, // dup1
|
|
// CHECK-NEXT: RTLIB::impl_other_func, // other_func
|
|
// CHECK-NEXT: RTLIB::impl_func_a, // func_a
|
|
// CHECK-NEXT: };
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: for (const RTLIB::LibcallImpl Impl : LibraryCalls) {
|
|
// CHECK-NEXT: setAvailable(Impl);
|
|
// CHECK-NEXT: }
|
|
// CHECK-EMPTY:
|
|
// CHECK-NEXT: return;
|
|
// CHECK-NEXT: }
|
|
|
|
// ERR: :[[@LINE+3]]:5: warning: conflicting implementations for libcall ANOTHER_DUP: dup1, dup0
|
|
// ERR: :[[@LINE+2]]:5: warning: conflicting implementations for libcall SOME_FUNC: func_a, func_b
|
|
// ERR: :[[@LINE+1]]:5: warning: conflicting implementations for libcall SOME_FUNC: func_a, func_c
|
|
def TheSystemLibraryC : SystemRuntimeLibrary<isTargetArchC,
|
|
(add func_a, dup1, other_func, func_b, func_c, dup0)
|
|
>;
|