[all-commits] [llvm/llvm-project] 2f4b30: [mlir][Standard] Add canonicalization for collapsi...

River Riddle via All-commits all-commits at lists.llvm.org
Thu Apr 23 04:51:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f4b303d683c91bb5b3799688ecc689f59ed9de5
      https://github.com/llvm/llvm-project/commit/2f4b303d683c91bb5b3799688ecc689f59ed9de5
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-04-23 (Thu, 23 Apr 2020)

  Changed paths:
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    A mlir/test/Dialect/Standard/canonicalize-cf.mlir
    M mlir/test/Transforms/canonicalize.mlir

  Log Message:
  -----------
  [mlir][Standard] Add canonicalization for collapsing pass through cond_br successors.

This revision adds support for the following canonicalization:

```
   cond_br %cond, ^bb1, ^bb2
 ^bb1
   br ^bbN(...)
 ^bb2
   br ^bbK(...)

   cond_br %cond, ^bbN(...), ^bbK(...)
```

Differential Revision: https://reviews.llvm.org/D78681


  Commit: af331bc52dc1a7c2bbfd09ddba1df4c7f3d321e7
      https://github.com/llvm/llvm-project/commit/af331bc52dc1a7c2bbfd09ddba1df4c7f3d321e7
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-04-23 (Thu, 23 Apr 2020)

  Changed paths:
    M llvm/include/llvm/ADT/STLExtras.h
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/IR/Block.h
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/IR/Block.cpp
    M mlir/test/Dialect/Standard/canonicalize-cf.mlir
    M mlir/test/IR/invalid-ops.mlir

  Log Message:
  -----------
  [mlir][Standard] Add a canonicalization to simplify cond_br when the successors are identical

This revision adds support for canonicalizing the following:

```
cond_br %cond, ^bb1(A, ..., N), ^bb1(A, ..., N)

br ^bb1(A, ..., N)
```

 If the operands to the successor are different and the cond_br is the only predecessor, we emit selects for the branch operands.

```
cond_br %cond, ^bb1(A), ^bb1(B)

%select = select %cond, A, B
br ^bb1(%select)
```

Differential Revision: https://reviews.llvm.org/D78682


  Commit: 2fafe7ff591da8de6454c11c4756cc13a89b1c27
      https://github.com/llvm/llvm-project/commit/2fafe7ff591da8de6454c11c4756cc13a89b1c27
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-04-23 (Thu, 23 Apr 2020)

  Changed paths:
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/test/Dialect/Standard/canonicalize-cf.mlir

  Log Message:
  -----------
  [mlir][Standard] Add support for canonicalizing branches to passthrough blocks

This revision adds support for canonicalizing the following:

```
   br ^bb1
 ^bb1
   br ^bbN(...)

 br ^bbN(...)
```

Differential Revision: https://reviews.llvm.org/D78683


  Commit: 7f85adb54d1956183630eb43c2f3e578f7366276
      https://github.com/llvm/llvm-project/commit/7f85adb54d1956183630eb43c2f3e578f7366276
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-04-23 (Thu, 23 Apr 2020)

  Changed paths:
    M llvm/include/llvm/ADT/STLExtras.h
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/test/Dialect/Standard/canonicalize-cf.mlir
    M mlir/test/IR/core-ops.mlir
    M mlir/test/IR/invalid-ops.mlir

  Log Message:
  -----------
  [mlir][Standard] Allow select to use an i1 for vector and tensor values

It currently requires that the condition match the shape of the selected value, but this is only really useful for things like masks. This revision allows for the use of i1 to mean that all of the vector/tensor is selected. This also matches the behavior of LLVM select. A benefit of this change is that transformations that want to generate selects, like those on the CFG, don't have to special case vector/tensor. Previously the only way to generate  a select from an i1 was to use a splat, but that doesn't support dynamically shaped/unranked tensors.

Differential Revision: https://reviews.llvm.org/D78690


Compare: https://github.com/llvm/llvm-project/compare/b108a457e1be...7f85adb54d19


More information about the All-commits mailing list