Mercurial > hg > CbC > CbC_llvm
diff mlir/test/IR/test-matchers.mlir @ 252:1f2b6ac9f198 llvm-original
LLVM16-1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Aug 2023 09:04:13 +0900 (2023-08-18) |
parents | c4bab56944e8 |
children |
line wrap: on
line diff
--- a/mlir/test/IR/test-matchers.mlir Wed Nov 09 17:47:54 2022 +0900 +++ b/mlir/test/IR/test-matchers.mlir Fri Aug 18 09:04:13 2023 +0900 @@ -1,4 +1,4 @@ -// RUN: mlir-opt %s -mlir-disable-threading=true -pass-pipeline="func.func(test-matchers)" -o /dev/null 2>&1 | FileCheck %s +// 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 @@ -41,3 +41,14 @@ // 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