[all-commits] [llvm/llvm-project] e502f4: [mlir][Arith] Remove expansions of integer min and...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Fri Jan 6 12:32:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e502f4fc2e25eedaca6bd8c1eacc6e0365ef403a
      https://github.com/llvm/llvm-project/commit/e502f4fc2e25eedaca6bd8c1eacc6e0365ef403a
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2023-01-06 (Fri, 06 Jan 2023)

  Changed paths:
    M mlir/lib/Dialect/Arith/Transforms/ExpandOps.cpp
    M mlir/test/Dialect/Arith/expand-ops.mlir

  Log Message:
  -----------
  [mlir][Arith] Remove expansions of integer min and max ops

As of several months ago, both ArithToLLVM and ArithToSPIRV have
native support for integer min and max operations. Since these are all
the targets available in MLIR core, the need to "expand" arith.minui,
arith.minsi, arith,maxsi, and arith.manxui to more primitive
operations is to longer present.

Therefore, the expanding of integer min and max operations in Arith,
while correct, is likely to lead to performance loss by way of
misoptimization further down the line, and is no longer needed for
anyone's correctness.

This change may break downstream tests, but will not affect the
semantics of MLIR programs.

arith.minf and arith.maxf have a lot of underlying complexity due to
the many different possible NaN and signed zero semantics available on
various platforms, and so removing their expansion is left to a future
commit.

Reviewed By: ThomasRaoux, Mogball

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




More information about the All-commits mailing list