@@ -51,8 +51,8 @@ func.func @negative_extract_slice_size_shrink(%tensor: tensor<1000xf32>) {
51
51
%c4_vscale = arith.muli %vscale , %c4 : index
52
52
%extracted_slice = tensor.extract_slice %tensor [0 ] [%c4_vscale ] [1 ] : tensor <1000 xf32 > to tensor <?xf32 >
53
53
%slice = scf.for %i = %c0 to %c1000 step %c4_vscale iter_args (%arg = %extracted_slice ) -> tensor <?xf32 > {
54
- // This mask cannot be eliminated even though looking at the above operations
55
- // it appears `tensor.dim` will always be c4_vscale (so the mask all-true).
54
+ // This mask cannot be eliminated even though looking at the operations above
55
+ // (this comment) it appears `tensor.dim` will always be c4_vscale (so the mask all-true).
56
56
%dim = tensor.dim %arg , %c0 : tensor <?xf32 >
57
57
%mask = vector.create_mask %dim : vector <[4 ]xi1 >
58
58
" test.some_use" (%mask ) : (vector <[4 ]xi1 >) -> ()
@@ -77,6 +77,8 @@ func.func @negative_constant_dim_not_all_true()
77
77
%c4 = arith.constant 4 : index
78
78
%vscale = vector.vscale
79
79
%c4_vscale = arith.muli %vscale , %c4 : index
80
+ // Since %c1 is a constant, this will be found not to be all-true via simple
81
+ // pattern matching.
80
82
%mask = vector.create_mask %c1 , %c4_vscale : vector <2 x[4 ]xi1 >
81
83
" test.some_use" (%mask ) : (vector <2 x[4 ]xi1 >) -> ()
82
84
return
@@ -93,6 +95,8 @@ func.func @negative_constant_vscale_multiple_not_all_true() {
93
95
%c3 = arith.constant 3 : index
94
96
%vscale = vector.vscale
95
97
%c3_vscale = arith.muli %vscale , %c3 : index
98
+ // Since %c3_vscale is a constant vscale multiple, this will be found not to
99
+ // be all-true via simple pattern matching.
96
100
%mask = vector.create_mask %c2 , %c3_vscale : vector <2 x[4 ]xi1 >
97
101
" test.some_use" (%mask ) : (vector <2 x[4 ]xi1 >) -> ()
98
102
return
0 commit comments