1
- // RUN: tcp-opt %s -canonicalize | FileCheck %s
1
+ // RUN: tcp-opt %s -canonicalize -split-input-file | FileCheck %s
2
2
3
3
// CHECK-LABEL: func.func @test_constant_folding() -> tensor<f32>
4
4
// CHECK: %[[CONST0:.*]] = tcp.const {value = dense<2.500000e+00> : tensor<f32>} : tensor<f32>
@@ -10,3 +10,20 @@ func.func @test_constant_folding() -> tensor<f32> {
10
10
%2 = tcp.mul %0 , %1 : tensor <f32 >, tensor <f32 > -> tensor <f32 >
11
11
return %2 : tensor <f32 >
12
12
}
13
+
14
+ // -----
15
+
16
+ // CHECK-LABEL: func.func @test_tcp_symbolic_int$canonicalize(
17
+ // CHECK-SAME: %[[ARG0:.*]]: tensor<?xf32>, %[[ARG1:.*]]: tensor<?xf32>) -> tensor<?xf32> {
18
+ // CHECK: %[[S0:.*]] = tcp.symbolic_int "s0" {min_val = 3, max_val = 6} : i64
19
+ // CHECK-NOT: %[[S1:.*]] = tcp.symbolic_int "s0 + 1" {min_val = 4, max_val = 7} : i64
20
+ // CHECK: tcp.bind_symbolic_shape %[[ARG0]], [%[[S0]]], affine_map<()[s0] -> (s0)> : tensor<?xf32>
21
+ // CHECK: tcp.bind_symbolic_shape %[[ARG1]], [%[[S0]]], affine_map<()[s0] -> (s0 + 1)> : tensor<?xf32>
22
+ // CHECK: return %[[ARG0]] : tensor<?xf32>
23
+ func.func @test_tcp_symbolic_int$canonicalize (%arg0: tensor <?xf32 >, %arg1: tensor <?xf32 >) -> tensor <?xf32 > {
24
+ %0 = tcp.symbolic_int " s0" {min_val = 3 , max_val = 6 } : i64
25
+ %1 = tcp.symbolic_int " s0 + 1" {min_val = 4 , max_val = 7 } : i64
26
+ tcp.bind_symbolic_shape %arg0 , [%0 ], affine_map <()[s0 ] -> (s0 )> : tensor <?xf32 >
27
+ tcp.bind_symbolic_shape %arg1 , [%0 ], affine_map <()[s0 ] -> (s0 + 1 )> : tensor <?xf32 >
28
+ return %arg0 : tensor <?xf32 >
29
+ }
0 commit comments