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
186 lines
5.7 KiB
MLIR
186 lines
5.7 KiB
MLIR
// RUN: mlir-opt -allow-unregistered-dialect %s -split-input-file -verify-diagnostics | FileCheck %s
|
|
// Verify that extensible dialects can register dynamic operations and types.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Dynamic type
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// CHECK-LABEL: func @succeededDynamicTypeVerifier
|
|
func.func @succeededDynamicTypeVerifier() {
|
|
// CHECK: %{{.*}} = "unregistered_op"() : () -> !test.dynamic_singleton
|
|
"unregistered_op"() : () -> !test.dynamic_singleton
|
|
// CHECK-NEXT: "unregistered_op"() : () -> !test.dynamic_pair<i32, f64>
|
|
"unregistered_op"() : () -> !test.dynamic_pair<i32, f64>
|
|
// CHECK-NEXT: %{{.*}} = "unregistered_op"() : () -> !test.dynamic_pair<!test.dynamic_pair<i32, f64>, !test.dynamic_singleton>
|
|
"unregistered_op"() : () -> !test.dynamic_pair<!test.dynamic_pair<i32, f64>, !test.dynamic_singleton>
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @failedDynamicTypeVerifier() {
|
|
// expected-error@+1 {{expected 0 type arguments, but had 1}}
|
|
"unregistered_op"() : () -> !test.dynamic_singleton<f64>
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @failedDynamicTypeVerifier2() {
|
|
// expected-error@+1 {{expected 2 type arguments, but had 1}}
|
|
"unregistered_op"() : () -> !test.dynamic_pair<f64>
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: func @customTypeParserPrinter
|
|
func.func @customTypeParserPrinter() {
|
|
// CHECK: "unregistered_op"() : () -> !test.dynamic_custom_assembly_format<f32:f64>
|
|
"unregistered_op"() : () -> !test.dynamic_custom_assembly_format<f32 : f64>
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Dynamic attribute
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// CHECK-LABEL: func @succeededDynamicAttributeVerifier
|
|
func.func @succeededDynamicAttributeVerifier() {
|
|
// CHECK: "unregistered_op"() {test_attr = #test.dynamic_singleton} : () -> ()
|
|
"unregistered_op"() {test_attr = #test.dynamic_singleton} : () -> ()
|
|
// CHECK-NEXT: "unregistered_op"() {test_attr = #test.dynamic_pair<3 : i32, 5 : i32>} : () -> ()
|
|
"unregistered_op"() {test_attr = #test.dynamic_pair<3 : i32, 5 : i32>} : () -> ()
|
|
// CHECK-NEXT: "unregistered_op"() {test_attr = #test.dynamic_pair<#test.dynamic_pair<3 : i32, 5 : i32>, f64>} : () -> ()
|
|
"unregistered_op"() {test_attr = #test.dynamic_pair<#test.dynamic_pair<3 : i32, 5 : i32>, f64>} : () -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @failedDynamicAttributeVerifier() {
|
|
// expected-error@+1 {{expected 0 attribute arguments, but had 1}}
|
|
"unregistered_op"() {test_attr = #test.dynamic_singleton<f64>} : () -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @failedDynamicAttributeVerifier2() {
|
|
// expected-error@+1 {{expected 2 attribute arguments, but had 1}}
|
|
"unregistered_op"() {test_attr = #test.dynamic_pair<f64>} : () -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: func @customAttributeParserPrinter
|
|
func.func @customAttributeParserPrinter() {
|
|
// CHECK: "unregistered_op"() {test_attr = #test.dynamic_custom_assembly_format<f32:f64>} : () -> ()
|
|
"unregistered_op"() {test_attr = #test.dynamic_custom_assembly_format<f32:f64>} : () -> ()
|
|
return
|
|
}
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Dynamic op
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: func @succeededDynamicOpVerifier
|
|
func.func @succeededDynamicOpVerifier(%a: f32) {
|
|
// CHECK: "test.dynamic_generic"() : () -> ()
|
|
// CHECK-NEXT: %{{.*}} = "test.dynamic_generic"(%{{.*}}) : (f32) -> f64
|
|
// CHECK-NEXT: %{{.*}}:2 = "test.dynamic_one_operand_two_results"(%{{.*}}) : (f32) -> (f64, f64)
|
|
"test.dynamic_generic"() : () -> ()
|
|
"test.dynamic_generic"(%a) : (f32) -> f64
|
|
"test.dynamic_one_operand_two_results"(%a) : (f32) -> (f64, f64)
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @failedDynamicOpVerifier() {
|
|
// expected-error@+1 {{expected 1 operand, but had 0}}
|
|
"test.dynamic_one_operand_two_results"() : () -> (f64, f64)
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @failedDynamicOpVerifier2(%a: f32) {
|
|
// expected-error@+1 {{expected 2 results, but had 0}}
|
|
"test.dynamic_one_operand_two_results"(%a) : (f32) -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: func @customOpParserPrinter
|
|
func.func @customOpParserPrinter() {
|
|
// CHECK: test.dynamic_custom_parser_printer custom_keyword
|
|
test.dynamic_custom_parser_printer custom_keyword
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @failedDynamicGenericOpNoTerminator() {
|
|
// expected-error@+1 {{empty block: expect at least a terminator}}
|
|
"test.dynamic_generic"() ({
|
|
^bb1:
|
|
}) : () -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @dynamicTerminatorOp() {
|
|
// CHECK: "test.dynamic_generic"()
|
|
"test.dynamic_generic"() ({
|
|
^bb1:
|
|
// CHECK: test.dynamic_terminator"()
|
|
"test.dynamic_terminator"() : () -> ()
|
|
}) : () -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @failedDynamicTerminatorOp() {
|
|
"test.dynamic_generic"() ({
|
|
^bb1:
|
|
// expected-error@+1 {{'test.dynamic_terminator' op must be the last operation in the parent block}}
|
|
"test.dynamic_terminator"() : () -> ()
|
|
"test.dynamic_generic"() : () -> ()
|
|
}) : () -> ()
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @dynamicNoTerminatorOp() {
|
|
// CHECK: "test.dynamic_noterminator"()
|
|
"test.dynamic_noterminator"() ({
|
|
^bb1:
|
|
}) : () -> ()
|
|
return
|
|
}
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Dynamic dialect
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// -----
|
|
|
|
// Check that the verifier of a dynamic operation in a dynamic dialect
|
|
// can fail. This shows that the dialect is correctly registered.
|
|
|
|
func.func @failedDynamicDialectOpVerifier() {
|
|
// expected-error@+1 {{expected a single result, no operands and no regions}}
|
|
"test_dyn.one_result"() : () -> ()
|
|
return
|
|
}
|