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
70 lines
3.0 KiB
MLIR
70 lines
3.0 KiB
MLIR
// RUN: mlir-opt %s -test-side-effects -verify-diagnostics
|
|
|
|
func.func @side_effect(%arg : index) {
|
|
// expected-remark@+1 {{operation has no memory effects}}
|
|
%0 = "test.side_effect_op"() {} : () -> i32
|
|
|
|
// expected-remark@+2 {{found an instance of 'read' on resource '<Default>'}}
|
|
// expected-remark@+1 {{found an instance of 'free' on resource '<Default>'}}
|
|
%1 = "test.side_effect_op"() {effects = [
|
|
{effect="read"}, {effect="free"}
|
|
]} : () -> i32
|
|
|
|
// expected-remark@+1 {{found an instance of 'write' on resource '<Test>'}}
|
|
%2 = "test.side_effect_op"() {effects = [
|
|
{effect="write", test_resource}
|
|
]} : () -> i32
|
|
|
|
// expected-remark@+1 {{found an instance of 'allocate' on op result 0, on resource '<Test>'}}
|
|
%3 = "test.side_effect_op"() {effects = [
|
|
{effect="allocate", on_result, test_resource}
|
|
]} : () -> i32
|
|
|
|
// expected-remark@+1 {{found an instance of 'read' on a symbol '@foo_ref', on resource '<Test>'}}
|
|
"test.side_effect_op"() {effects = [
|
|
{effect="read", on_reference = @foo_ref, test_resource}
|
|
]} : () -> i32
|
|
|
|
// No _memory_ effects, but a parametric test effect.
|
|
// expected-remark@+2 {{operation has no memory effects}}
|
|
// expected-remark@+1 {{found a parametric effect with affine_map<(d0, d1) -> (d1, d0)>}}
|
|
%4 = "test.side_effect_op"() {
|
|
effect_parameter = affine_map<(i, j) -> (j, i)>
|
|
} : () -> i32
|
|
|
|
// Check with this unregistered operation to test the fallback on the dialect.
|
|
// expected-remark@+1 {{found a parametric effect with affine_map<(d0, d1) -> (d1, d0)>}}
|
|
%5 = "test.unregistered_side_effect_op"() {
|
|
effect_parameter = affine_map<(i, j) -> (j, i)>
|
|
} : () -> i32
|
|
|
|
// expected-remark@+1 {{found an instance of 'allocate' on op operand 0, on resource '<Test>'}}
|
|
%6 = test.side_effect_with_region_op (%arg) {
|
|
^bb0(%arg0 : index):
|
|
test.region_yield %arg0 : index
|
|
} {effects = [ {effect="allocate", on_operand, test_resource} ]} : index -> index
|
|
|
|
// expected-remark@+1 {{found an instance of 'allocate' on op result 0, on resource '<Test>'}}
|
|
%7 = test.side_effect_with_region_op (%arg) {
|
|
^bb0(%arg0 : index):
|
|
test.region_yield %arg0 : index
|
|
} {effects = [ {effect="allocate", on_result, test_resource} ]} : index -> index
|
|
|
|
// expected-remark@+1 {{found an instance of 'allocate' on block argument 0, on resource '<Test>'}}
|
|
%8 = test.side_effect_with_region_op (%arg) {
|
|
^bb0(%arg0 : index):
|
|
test.region_yield %arg0 : index
|
|
} {effects = [ {effect="allocate", on_argument, test_resource} ]} : index -> index
|
|
|
|
// expected-remark@+1 {{operation has no memory effects}}
|
|
%9 = "test.conditional_side_effect_op"() {has_effects = false} : () -> i32
|
|
|
|
// expected-remark@+4 {{found an instance of 'read' on resource '<Default>'}}
|
|
// expected-remark@+3 {{found an instance of 'write' on resource '<Default>'}}
|
|
// expected-remark@+2 {{found an instance of 'free' on resource '<Default>'}}
|
|
// expected-remark@+1 {{found an instance of 'allocate' on resource '<Default>'}}
|
|
%10 = "test.conditional_side_effect_op"() {has_effects = true} : () -> i32
|
|
|
|
func.return
|
|
}
|