[Mlir-commits] [mlir] [MLIR][Vector] Update Transfer{Read|Write}DropUnitDimsPattern patterns (PR #112394)

Han-Chung Wang llvmlistbot at llvm.org
Thu Oct 17 16:16:55 PDT 2024


https://github.com/hanhanW requested changes to this pull request.

I was looking for some tests with shape_cast ops generated; I found that it does not support the below case. Can you take a look?

Note: it is a test in the original file and I just added a `vector.mask` op around it.

```mlir
func.func @transfer_read_and_vector_rank_reducing_to_0d_masked(
      %arg : memref<1x1x1x1x1xf32>,
      %mask: vector<1x1x1xi1>) -> vector<1x1x1xf32> {
    %c0 = arith.constant 0 : index
    %cst = arith.constant 0.0 : f32
    %v = vector.mask %mask {
      vector.transfer_read %arg[%c0, %c0, %c0, %c0, %c0], %cst :
      memref<1x1x1x1x1xf32>, vector<1x1x1xf32>
    } : vector<1x1x1xi1> -> vector<1x1x1xf32>
    return %v : vector<1x1x1xf32>
}
module attributes {transform.with_named_sequence} {
  transform.named_sequence @__transform_main(%root : !transform.any_op {transform.readonly}) {
    %func_op = transform.structured.match ops{["func.func"]} in %root : (!transform.any_op) -> !transform.op<"func.func">
    transform.apply_patterns to %func_op {
      transform.apply_patterns.vector.rank_reducing_subview_patterns
    } : !transform.op<"func.func">
    transform.yield
  }
}
```

https://github.com/llvm/llvm-project/pull/112394


More information about the Mlir-commits mailing list