Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 3ca986c

Browse files
canonicalize test
1 parent 3cd4c61 commit 3ca986c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/Dialect/canonicalize.mlir

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: tcp-opt %s -canonicalize | FileCheck %s
1+
// RUN: tcp-opt %s -canonicalize -split-input-file | FileCheck %s
22

33
// CHECK-LABEL: func.func @test_constant_folding() -> tensor<f32>
44
// CHECK: %[[CONST0:.*]] = tcp.const {value = dense<2.500000e+00> : tensor<f32>} : tensor<f32>
@@ -10,3 +10,20 @@ func.func @test_constant_folding() -> tensor<f32> {
1010
%2 = tcp.mul %0, %1 : tensor<f32>, tensor<f32> -> tensor<f32>
1111
return %2 : tensor<f32>
1212
}
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

Comments
 (0)