[all-commits] [llvm/llvm-project] b0b004: [mlir][Arith] Pass to switch signed ops for equiva...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Tue Jun 14 14:18:43 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b0b00432093be9680ed833af642bcafc3ca11586
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2022-06-14 (Tue, 14 Jun 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Arithmetic/Transforms/Passes.h
    M mlir/include/mlir/Dialect/Arithmetic/Transforms/Passes.td
    M mlir/lib/Dialect/Arithmetic/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Arithmetic/Transforms/UnsignedWhenEquivalent.cpp
    A mlir/test/Dialect/Arithmetic/unsigned-when-equivalent.mlir

  Log Message:
  [mlir][Arith] Pass to switch signed ops for equivalent unsigned ones

If all the arguments to and results of an operation are known to be
non-negative when interpreted as signed (which also implies that all
computations producing those values did not experience signed
overflow), we can replace that operation with an equivalent one that
operates on unsigned values.

Such a replacement, when it is possible, can provide useful hints to
backends, such as by allowing LLVM to replace remainder with bitwise
operations in more cases.

Depends on D124022

Depends on D124023

Reviewed By: Mogball

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

More information about the All-commits mailing list