|
1 | 1 | // RUN: mlir-opt %s --eliminate-libm --verify-diagnostics --split-input-file | FileCheck %s |
2 | 2 |
|
3 | 3 | // CHECK: emitc.include <"cmath"> |
4 | | -// CHECK-NOT: func.func private @expm1 |
5 | | -// CHECK-DAG: func.func @call_expm1(%[[IN:.*]]: f64) -> f64 |
| 4 | +// CHECK-NOT: emitc.func private @expm1 |
| 5 | +// CHECK-DAG: emitc.func @call_expm1(%[[IN:.*]]: f64) -> f64 |
6 | 6 | // CHECK-DAG: %[[RESULT:.*]] = emitc.call_opaque "expm1"(%[[IN]]) : (f64) -> f64 |
7 | 7 | // CHECK-DAG: return %[[RESULT]] |
8 | 8 | module { |
9 | | - func.func private @expm1(f64) -> f64 attributes {libm, llvm.readnone} |
10 | | - func.func @call_expm1(%in : f64) -> f64 { |
11 | | - %e1 = func.call @expm1(%in) : (f64) -> f64 |
12 | | - return %e1 : f64 |
| 9 | + emitc.func private @expm1(f64) -> f64 attributes {libm, llvm.readnone, specifiers = ["extern"]} |
| 10 | + emitc.func @call_expm1(%in : f64) -> f64 { |
| 11 | + %e1 = emitc.call @expm1(%in) : (f64) -> f64 |
| 12 | + emitc.return %e1 : f64 |
13 | 13 | } |
14 | 14 | } |
15 | 15 |
|
16 | 16 | // ----- |
17 | 17 |
|
18 | 18 | // CHECK-NOT: emitc.include <"cmath"> |
19 | | -// CHECK: func.func private @expm1 |
20 | | -// CHECK: func.func @call_expm1(%[[IN:.*]]: f64) -> f64 |
21 | | -// CHECK-NEXT: %[[RESULT:.*]] = call @expm1(%[[IN]]) : (f64) -> f64 |
| 19 | +// CHECK: emitc.func private @expm1 |
| 20 | +// CHECK: emitc.func @call_expm1(%[[IN:.*]]: f64) -> f64 |
| 21 | +// CHECK-NEXT: %[[RESULT:.*]] = emitc.call @expm1(%[[IN]]) : (f64) -> f64 |
22 | 22 | // CHECK-NEXT: return %[[RESULT]] |
23 | 23 | module { |
24 | | - func.func private @expm1(f64) -> f64 attributes {llvm.readnone} |
25 | | - func.func @call_expm1(%in : f64) -> f64 { |
26 | | - %e1 = func.call @expm1(%in) : (f64) -> f64 |
27 | | - return %e1 : f64 |
| 24 | + emitc.func private @expm1(f64) -> f64 attributes {llvm.readnone} |
| 25 | + emitc.func @call_expm1(%in : f64) -> f64 { |
| 26 | + %e1 = emitc.call @expm1(%in) : (f64) -> f64 |
| 27 | + emitc.return %e1 : f64 |
28 | 28 | } |
29 | 29 | } |
0 commit comments