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
65 lines
2.4 KiB
MLIR
65 lines
2.4 KiB
MLIR
// RUN: mlir-opt %s -mlir-disable-threading=true -pass-pipeline="builtin.module(func.func(test-matchers))" -o /dev/null 2>&1 | FileCheck %s
|
|
|
|
func.func @test1(%a: f32, %b: f32, %c: f32) {
|
|
%0 = arith.addf %a, %b: f32
|
|
%1 = arith.addf %a, %c: f32
|
|
%2 = arith.addf %c, %b: f32
|
|
%3 = arith.mulf %a, %2: f32
|
|
%4 = arith.mulf %3, %1: f32
|
|
%5 = arith.mulf %4, %4: f32
|
|
%6 = arith.mulf %5, %5: f32
|
|
return
|
|
}
|
|
|
|
// CHECK-LABEL: test1
|
|
// CHECK: Pattern add(*) matched 3 times
|
|
// CHECK: Pattern mul(*) matched 4 times
|
|
// CHECK: Pattern add(add(*), *) matched 0 times
|
|
// CHECK: Pattern add(*, add(*)) matched 0 times
|
|
// CHECK: Pattern mul(add(*), *) matched 0 times
|
|
// CHECK: Pattern mul(*, add(*)) matched 2 times
|
|
// CHECK: Pattern mul(mul(*), *) matched 3 times
|
|
// CHECK: Pattern mul(mul(*), mul(*)) matched 2 times
|
|
// CHECK: Pattern mul(mul(mul(*), mul(*)), mul(mul(*), mul(*))) matched 1 times
|
|
// CHECK: Pattern mul(mul(mul(mul(*), add(*)), mul(*)), mul(mul(*, add(*)), mul(*, add(*)))) matched 1 times
|
|
// CHECK: Pattern add(a, b) matched 1 times
|
|
// CHECK: Pattern add(a, c) matched 1 times
|
|
// CHECK: Pattern add(b, a) matched 0 times
|
|
// CHECK: Pattern add(c, a) matched 0 times
|
|
// CHECK: Pattern mul(a, add(c, b)) matched 1 times
|
|
// CHECK: Pattern mul(a, add(b, c)) matched 0 times
|
|
// CHECK: Pattern mul(mul(a, *), add(a, c)) matched 1 times
|
|
// CHECK: Pattern mul(mul(a, *), add(c, b)) matched 0 times
|
|
|
|
func.func @test2(%a: f32) -> f32 {
|
|
%0 = arith.constant 1.0: f32
|
|
%1 = arith.addf %a, %0: f32
|
|
%2 = arith.mulf %a, %1: f32
|
|
return %2: f32
|
|
}
|
|
|
|
// CHECK-LABEL: test2
|
|
// CHECK: Pattern add(add(a, constant), a) matched and bound constant to: 1.000000e+00
|
|
// CHECK: Pattern add(add(a, constant), a) matched
|
|
|
|
func.func @test3(%a: f32) -> f32 {
|
|
%0 = "test.name"() {value = 1.0 : f32} : () -> f32
|
|
%1 = arith.addf %a, %0: f32
|
|
%2 = arith.mulf %a, %1 fastmath<fast>: f32
|
|
return %2: f32
|
|
}
|
|
|
|
// CHECK-LABEL: test3
|
|
// CHECK: Pattern mul(*, add(*, m_Op("test.name"))) matched
|
|
// CHECK: Pattern m_Attr("fastmath") matched and bound value to: fast
|
|
|
|
func.func @test4(%a: f32) -> f32 {
|
|
%0 = ub.poison : f32
|
|
%1 = arith.constant 1.0 : f32
|
|
%2 = arith.addf %a, %1 : f32
|
|
return %2 : f32
|
|
}
|
|
|
|
// CHECK-LABEL: test4
|
|
// CHECK: Pattern m_Poison() matched 1 times
|