Skip to content

Commit 2a46627

Browse files
committed
Comments
1 parent 0f2b823 commit 2a46627

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mlir/test/Dialect/Vector/eliminate-masks.mlir

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ func.func @negative_extract_slice_size_shrink(%tensor: tensor<1000xf32>) {
5151
%c4_vscale = arith.muli %vscale, %c4 : index
5252
%extracted_slice = tensor.extract_slice %tensor[0] [%c4_vscale] [1] : tensor<1000xf32> to tensor<?xf32>
5353
%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).
5656
%dim = tensor.dim %arg, %c0 : tensor<?xf32>
5757
%mask = vector.create_mask %dim : vector<[4]xi1>
5858
"test.some_use"(%mask) : (vector<[4]xi1>) -> ()
@@ -77,6 +77,8 @@ func.func @negative_constant_dim_not_all_true()
7777
%c4 = arith.constant 4 : index
7878
%vscale = vector.vscale
7979
%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.
8082
%mask = vector.create_mask %c1, %c4_vscale : vector<2x[4]xi1>
8183
"test.some_use"(%mask) : (vector<2x[4]xi1>) -> ()
8284
return
@@ -93,6 +95,8 @@ func.func @negative_constant_vscale_multiple_not_all_true() {
9395
%c3 = arith.constant 3 : index
9496
%vscale = vector.vscale
9597
%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.
96100
%mask = vector.create_mask %c2, %c3_vscale : vector<2x[4]xi1>
97101
"test.some_use"(%mask) : (vector<2x[4]xi1>) -> ()
98102
return

0 commit comments

Comments
 (0)