[all-commits] [llvm/llvm-project] d4fd20: [mlir] Use arith max or min ops instead of cmp + s...

mlevesquedion via All-commits all-commits at lists.llvm.org
Wed Feb 21 12:28:18 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4fd20258f63d30be638b04f10eaa469707759f0
      https://github.com/llvm/llvm-project/commit/d4fd20258f63d30be638b04f10eaa469707759f0
  Author: mlevesquedion <mlevesquedion at google.com>
  Date:   2024-02-21 (Wed, 21 Feb 2024)

  Changed paths:
    M mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
    M mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
    M mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
    M mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
    M mlir/lib/Dialect/SCF/Utils/Utils.cpp
    M mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp
    M mlir/test/Conversion/AffineToStandard/lower-affine.mlir
    M mlir/test/Conversion/MemRefToLLVM/expand-then-convert-to-llvm.mlir
    M mlir/test/Conversion/ShapeToStandard/shape-to-standard.mlir
    M mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-named.mlir
    M mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-resize.mlir
    M mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
    M mlir/test/Transforms/parametric-tiling.mlir

  Log Message:
  -----------
  [mlir] Use arith max or min ops instead of cmp + select (#82178)

I believe the semantics should be the same, but this saves 1 op and simplifies the code.

For example, the following two instructions:

```
%2 = cmp sgt %0, %1
%3 = select %2, %0, %1
```

Are equivalent to:

```
%2 = maxsi %0 %1
```



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