comparison 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
parents c4bab56944e8
children
comparison
equal deleted inserted replaced
237:c80f45b162ad 252:1f2b6ac9f198
1 // RUN: mlir-opt %s -mlir-disable-threading=true -pass-pipeline="func.func(test-matchers)" -o /dev/null 2>&1 | FileCheck %s 1 // RUN: mlir-opt %s -mlir-disable-threading=true -pass-pipeline="builtin.module(func.func(test-matchers))" -o /dev/null 2>&1 | FileCheck %s
2 2
3 func.func @test1(%a: f32, %b: f32, %c: f32) { 3 func.func @test1(%a: f32, %b: f32, %c: f32) {
4 %0 = arith.addf %a, %b: f32 4 %0 = arith.addf %a, %b: f32
5 %1 = arith.addf %a, %c: f32 5 %1 = arith.addf %a, %c: f32
6 %2 = arith.addf %c, %b: f32 6 %2 = arith.addf %c, %b: f32
39 } 39 }
40 40
41 // CHECK-LABEL: test2 41 // CHECK-LABEL: test2
42 // CHECK: Pattern add(add(a, constant), a) matched and bound constant to: 1.000000e+00 42 // CHECK: Pattern add(add(a, constant), a) matched and bound constant to: 1.000000e+00
43 // CHECK: Pattern add(add(a, constant), a) matched 43 // CHECK: Pattern add(add(a, constant), a) matched
44
45 func.func @test3(%a: f32) -> f32 {
46 %0 = "test.name"() {value = 1.0 : f32} : () -> f32
47 %1 = arith.addf %a, %0: f32
48 %2 = arith.mulf %a, %1 fastmath<fast>: f32
49 return %2: f32
50 }
51
52 // CHECK-LABEL: test3
53 // CHECK: Pattern mul(*, add(*, m_Op("test.name"))) matched
54 // CHECK: Pattern m_Attr("fastmath") matched and bound value to: fast