aboutsummaryrefslogtreecommitdiff
path: root/mlir/test/IR/test-func-erase-arg.mlir
blob: 7a27bd219c21ff59dec4c797ad2f385fd9a02b94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// RUN: mlir-opt %s -test-func-erase-arg -split-input-file | FileCheck %s

// CHECK: func @f()
// CHECK-NOT: attributes{{.*}}arg
func.func @f(%arg0: f32 {test.erase_this_arg}) {
  return
}

// -----

// CHECK: func @f(%arg0: f32 {test.A})
// CHECK-NOT: attributes{{.*}}arg
func.func @f(
  %arg0: f32 {test.erase_this_arg},
  %arg1: f32 {test.A}) {
  return
}

// -----

// CHECK: func @f(%arg0: f32 {test.A})
// CHECK-NOT: attributes{{.*}}arg
func.func @f(
  %arg0: f32 {test.A},
  %arg1: f32 {test.erase_this_arg}) {
  return
}

// -----

// CHECK: func @f(%arg0: f32 {test.A}, %arg1: f32 {test.B})
// CHECK-NOT: attributes{{.*}}arg
func.func @f(
  %arg0: f32 {test.A},
  %arg1: f32 {test.erase_this_arg},
  %arg2: f32 {test.B}) {
  return
}

// -----

// CHECK: func @f(%arg0: f32 {test.A}, %arg1: f32 {test.B})
// CHECK-NOT: attributes{{.*}}arg
func.func @f(
  %arg0: f32 {test.A},
  %arg1: f32 {test.erase_this_arg},
  %arg2: f32 {test.erase_this_arg},
  %arg3: f32 {test.B}) {
  return
}

// -----

// CHECK: func @f(%arg0: f32 {test.A}, %arg1: f32 {test.B}, %arg2: f32 {test.C})
// CHECK-NOT: attributes{{.*}}arg
func.func @f(
  %arg0: f32 {test.A},
  %arg1: f32 {test.erase_this_arg},
  %arg2: f32 {test.B},
  %arg3: f32 {test.erase_this_arg},
  %arg4: f32 {test.C}) {
  return
}

// -----

// CHECK: func @f(%arg0: tensor<1xf32>, %arg1: tensor<2xf32>, %arg2: tensor<3xf32>)
// CHECK-NOT: attributes{{.*}}arg
func.func @f(
  %arg0: tensor<1xf32>,
  %arg1: f32 {test.erase_this_arg},
  %arg2: tensor<2xf32>,
  %arg3: f32 {test.erase_this_arg},
  %arg4: tensor<3xf32>) {
  return
}