[all-commits] [llvm/llvm-project] 35b292: [mlir][Hoisting] Hoisting vector.extract/vector.br...

Steven Varoumas via All-commits all-commits at lists.llvm.org
Mon Apr 22 05:54:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 35b292efc6fc31b884255d7cb46db7d6346c6f46
      https://github.com/llvm/llvm-project/commit/35b292efc6fc31b884255d7cb46db7d6346c6f46
  Author: Steven Varoumas <steven.varoumas1 at huawei.com>
  Date:   2024-04-22 (Mon, 22 Apr 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
    M mlir/include/mlir/Dialect/Linalg/Transforms/Hoisting.h
    M mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
    M mlir/test/Dialect/Linalg/hoisting.mlir

  Log Message:
  -----------
  [mlir][Hoisting] Hoisting vector.extract/vector.broadcast pairs (#86108)

This transformation, inspired by what is done in
hoist_redundant_transfers, hoists pairs of extract/broadcast operations
out of scf.for loops.

It changes a loop of the form:

```
%res = scf.for _ = _ to _ step _ iter_args(%iarg = %v) -> (t1) {
  %e = vector.extract %iarg : t1 to t2
  %u = "some_use"(%e) : (t2) -> t2
  %b = vector.broadcast %u : t2 to t1
  scf.yield %b : t1
}
```

into the following:

```
%e = vector.extract %v: t1 to t2
%res' = scf.for _ = _ to _ step _ iter_args(%iarg = %e) -> (t2) {
  %u' = "some_use"(%iarg) : (t2) -> t2
  scf.yield %u' : t2
}
%res = vector.broadcast %res' : t2 to t1
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list