Files
TheRock/compiler/amd-llvm/mlir/test/Dialect/PDLInterp/ops.mlir
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

76 lines
2.1 KiB
MLIR

// RUN: mlir-opt -split-input-file %s | mlir-opt
// Verify the printed output can be parsed.
// RUN: mlir-opt %s | mlir-opt
// Verify the generic form can be parsed.
// RUN: mlir-opt -mlir-print-op-generic %s | mlir-opt
// -----
// Unused operation to force loading the `arithmetic` dialect for the
// test of type inferrence.
arith.constant true
func.func @operations(%attribute: !pdl.attribute,
%input: !pdl.value,
%type: !pdl.type) {
// attributes, operands, and results
%op0 = pdl_interp.create_operation "foo.op"(%input : !pdl.value) {"attr" = %attribute} -> (%type : !pdl.type)
// attributes, and results
%op1 = pdl_interp.create_operation "foo.op" {"attr" = %attribute} -> (%type : !pdl.type)
// attributes
%op2 = pdl_interp.create_operation "foo.op" {"attr" = %attribute, "attr1" = %attribute}
// operands, and results
%op3 = pdl_interp.create_operation "foo.op"(%input : !pdl.value) -> (%type : !pdl.type)
// inferred results
%op4 = pdl_interp.create_operation "arith.constant" -> <inferred>
pdl_interp.finalize
}
// -----
func.func @extract(%attrs : !pdl.range<attribute>, %ops : !pdl.range<operation>, %types : !pdl.range<type>, %vals: !pdl.range<value>) {
// attribute at index 0
%attr = pdl_interp.extract 0 of %attrs : !pdl.attribute
// operation at index 1
%op = pdl_interp.extract 1 of %ops : !pdl.operation
// type at index 2
%type = pdl_interp.extract 2 of %types : !pdl.type
// value at index 3
%val = pdl_interp.extract 3 of %vals : !pdl.value
pdl_interp.finalize
}
// -----
func.func @foreach(%ops: !pdl.range<operation>) {
// iterate over a range of operations
pdl_interp.foreach %op : !pdl.operation in %ops {
%val = pdl_interp.get_result 0 of %op
pdl_interp.continue
} -> ^end
^end:
pdl_interp.finalize
}
// -----
func.func @users(%value: !pdl.value, %values: !pdl.range<value>) {
// all the users of a single value
%ops1 = pdl_interp.get_users of %value : !pdl.value
// all the users of all the values in a range
%ops2 = pdl_interp.get_users of %values : !pdl.range<value>
pdl_interp.finalize
}