Files
TheRock/compiler/amd-llvm/mlir/test/mlir-tblgen/openmp-clause-ops.td
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

85 lines
3.4 KiB
TableGen

// Tablegen tests for the automatic generation of OpenMP clause operand
// structure definitions.
// Run tablegen to generate OmpCommon.td in temp directory first.
// RUN: mkdir -p %t/mlir/Dialect/OpenMP
// RUN: mlir-tblgen --gen-directive-decl --directives-dialect=OpenMP \
// RUN: %S/../../../llvm/include/llvm/Frontend/OpenMP/OMP.td \
// RUN: -I %S/../../../llvm/include > %t/mlir/Dialect/OpenMP/OmpCommon.td
// RUN: mlir-tblgen -gen-openmp-clause-ops -I %S/../../include -I %t %s 2>&1 | FileCheck %s
include "mlir/Dialect/OpenMP/OpenMPOpBase.td"
def OpenMP_MyFirstClause : OpenMP_Clause<
/*skipTraits=*/false, /*skipArguments=*/false, /*skipAssemblyFormat=*/false,
/*skipDescription=*/false, /*skipExtraClassDeclaration=*/false> {
let arguments = (ins
// Simple attributes
I32Attr:$int_attr,
TypeAttr:$type_attr,
DeclareTargetAttr:$omp_attr,
// Array attributes
F32ArrayAttr:$float_array_attr,
StrArrayAttr:$str_array_attr,
AnyIntElementsAttr:$anyint_elems_attr,
RankedF32ElementsAttr<[3, 4, 5]>:$float_nd_elems_attr,
// Optional attributes
OptionalAttr<BoolAttr>:$opt_bool_attr,
OptionalAttr<I64ArrayAttr>:$opt_int_array_attr,
OptionalAttr<DenseI8ArrayAttr>:$opt_int_elems_attr,
// Multi-level composition
ConfinedAttr<OptionalAttr<I64Attr>, [IntMinValue<0>]>:$complex_opt_int_attr,
// ElementsAttrBase-related edge cases.
// CHECK: warning: could not infer array-like attribute element type for argument 'elements_attr', will use bare `storageType`
ElementsAttr:$elements_attr,
// CHECK: warning: could not infer array-like attribute element type for argument 'string_elements_attr', will use bare `storageType`
StringElementsAttr:$string_elements_attr
);
}
// CHECK: struct MyFirstClauseOps {
// CHECK-NEXT: ::mlir::IntegerAttr intAttr;
// CHECK-NEXT: ::mlir::TypeAttr typeAttr;
// CHECK-NEXT: ::mlir::omp::DeclareTargetAttr ompAttr;
// CHECK-NEXT: ::llvm::SmallVector<::mlir::Attribute> floatArrayAttr;
// CHECK-NEXT: ::llvm::SmallVector<::mlir::Attribute> strArrayAttr;
// CHECK-NEXT: ::llvm::SmallVector<::llvm::APInt> anyintElemsAttr;
// CHECK-NEXT: ::llvm::SmallVector<::llvm::APFloat> floatNdElemsAttr;
// CHECK-NEXT: ::mlir::BoolAttr optBoolAttr;
// CHECK-NEXT: ::llvm::SmallVector<::mlir::Attribute> optIntArrayAttr;
// CHECK-NEXT: ::llvm::SmallVector<int8_t> optIntElemsAttr;
// CHECK-NEXT: ::mlir::IntegerAttr complexOptIntAttr;
// CHECK-NEXT: ::mlir::ElementsAttr elementsAttr;
// CHECK-NEXT: ::mlir::DenseElementsAttr stringElementsAttr;
// CHECK-NEXT: }
def OpenMP_MySecondClause : OpenMP_Clause<
/*skipTraits=*/false, /*skipArguments=*/false, /*skipAssemblyFormat=*/false,
/*skipDescription=*/false, /*skipExtraClassDeclaration=*/false> {
let arguments = (ins
I32:$int_val,
Optional<AnyType>:$opt_any_val,
Variadic<Index>:$variadic_index_val
);
}
// CHECK: struct MySecondClauseOps {
// CHECK-NEXT: ::mlir::Value intVal;
// CHECK-NEXT: ::mlir::Value optAnyVal;
// CHECK-NEXT: ::llvm::SmallVector<::mlir::Value> variadicIndexVal;
// CHECK-NEXT: }
def OpenMP_MyFirstOp : OpenMP_Op<"op", clauses=[OpenMP_MyFirstClause]>;
// CHECK: using MyFirstOperands = detail::Clauses<MyFirstClauseOps>;
def OpenMP_MySecondOp : OpenMP_Op<"op", clauses=[OpenMP_MyFirstClause, OpenMP_MySecondClause]>;
// CHECK: using MySecondOperands = detail::Clauses<MyFirstClauseOps, MySecondClauseOps>;