[all-commits] [llvm/llvm-project] 6876fe: [mlir][linalg] Add a test to demonstrate peeling +...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Wed Jan 10 07:19:29 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6876fe53afabfc6f0c3b5e7c838f32a282da6f77
      https://github.com/llvm/llvm-project/commit/6876fe53afabfc6f0c3b5e7c838f32a282da6f77
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2024-01-10 (Wed, 10 Jan 2024)

  Changed paths:
    A mlir/test/Dialect/Linalg/transform-op-peel-and-vectorize.mlir

  Log Message:
  -----------
  [mlir][linalg] Add a test to demonstrate peeling + vectorisation (#77590)

Following on from #75842, we can demonstrate that loop peeling combined
with masked vectorisation and existing canonicalization for vector.mask
operations leads to the following loop structure:

```
// M dimension
scf.for 1:M
  // N dimension (contains vector ops _without_ masking)
  scf.for 1:UB
    // K dimension
    scf.for 1:K
      vector.add

  // N dimension (contains vector ops _with_ masking)
  scf.for UB:N
    // K dimension
    scf.for 1:K
      vector.mask { vector.add }
```

This is particularly beneficial for scalable vectors which normally
require masking. This example demonstrates how to avoid them.




More information about the All-commits mailing list