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
73 lines
2.3 KiB
TableGen
73 lines
2.3 KiB
TableGen
// RUN: llvm-tblgen -gen-intrinsic-impl -I %p/../../include %s | FileCheck %s
|
|
|
|
// Test ArgInfo property for pretty-printing intrinsic arguments.
|
|
// This test verifies that TableGen generates the correct pretty-printing code
|
|
// for intrinsics that use the ArgInfo property.
|
|
|
|
include "llvm/IR/Intrinsics.td"
|
|
|
|
// Simple intrinsic with two arguments that have ArgInfo.
|
|
def int_dummy_foo_bar : DefaultAttrsIntrinsic<
|
|
[llvm_i32_ty],
|
|
[llvm_i32_ty, // data
|
|
llvm_i32_ty, // mode
|
|
llvm_i32_ty], // stride
|
|
[IntrNoMem,
|
|
ImmArg<ArgIndex<1>>,
|
|
ArgInfo<ArgIndex<1>, [ArgName<"mode">, ImmArgPrinter<"printDummyMode">]>,
|
|
ArgInfo<ArgIndex<2>, [ArgName<"stride">]>]>;
|
|
|
|
// A custom floating point add with rounding and sat mode.
|
|
def int_my_fadd_f32 : DefaultAttrsIntrinsic<
|
|
[llvm_float_ty],
|
|
[llvm_float_ty, // a
|
|
llvm_float_ty, // b
|
|
llvm_i32_ty, // rounding_mode
|
|
llvm_i1_ty], // saturation_mode
|
|
[IntrNoMem,
|
|
ImmArg<ArgIndex<2>>,
|
|
ImmArg<ArgIndex<3>>,
|
|
ArgInfo<ArgIndex<2>, [ArgName<"rounding_mode">, ImmArgPrinter<"printRoundingMode">]>,
|
|
ArgInfo<ArgIndex<3>, [ArgName<"saturation_mode">]>]>;
|
|
|
|
// CHECK: #ifdef GET_INTRINSIC_PRETTY_PRINT_TABLE
|
|
// CHECK-NEXT: #undef GET_INTRINSIC_PRETTY_PRINT_TABLE
|
|
// CHECK: static constexpr uint8_t PPTable[] = {
|
|
// CHECK: #endif // GET_INTRINSIC_PRETTY_PRINT_TABLE
|
|
|
|
// CHECK: #ifdef GET_INTRINSIC_PRETTY_PRINT_ARGUMENTS
|
|
// CHECK-NEXT: #undef GET_INTRINSIC_PRETTY_PRINT_ARGUMENTS
|
|
// CHECK: void Intrinsic::printImmArg(ID IID, unsigned ArgIdx, raw_ostream &OS, const Constant *ImmArgVal) {
|
|
|
|
// CHECK: case dummy_foo_bar:
|
|
// CHECK-NEXT: switch (ArgIdx) {
|
|
|
|
// CHECK-NEXT: case 1:
|
|
// CHECK-NEXT: OS << "mode=";
|
|
// CHECK-NEXT: printDummyMode(OS, ImmArgVal);
|
|
// CHECK-NEXT: return;
|
|
|
|
// CHECK-NEXT: case 2:
|
|
// CHECK-NEXT: OS << "stride=";
|
|
// CHECK-NEXT: return;
|
|
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: break;
|
|
|
|
// CHECK: case my_fadd_f32:
|
|
// CHECK-NEXT: switch (ArgIdx) {
|
|
|
|
// CHECK-NEXT: case 2:
|
|
// CHECK-NEXT: OS << "rounding_mode=";
|
|
// CHECK-NEXT: printRoundingMode(OS, ImmArgVal);
|
|
// CHECK-NEXT: return;
|
|
|
|
// CHECK-NEXT: case 3:
|
|
// CHECK-NEXT: OS << "saturation_mode=";
|
|
// CHECK-NEXT: return;
|
|
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: break;
|
|
|
|
// CHECK: #endif // GET_INTRINSIC_PRETTY_PRINT_ARGUMENTS
|