[all-commits] [llvm/llvm-project] c86428: [mlir][transforms] Simplify OperationEquivalence a...

Matthias Springer via All-commits all-commits at lists.llvm.org
Fri Jan 27 02:57:29 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c864288dcf169fd1aa663320b7414c0ee72d5c2b
      https://github.com/llvm/llvm-project/commit/c864288dcf169fd1aa663320b7414c0ee72d5c2b
  Author: Matthias Springer <springerm at google.com>
  Date:   2023-01-27 (Fri, 27 Jan 2023)

  Changed paths:
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/lib/IR/OperationSupport.cpp
    M mlir/lib/Transforms/CSE.cpp
    M mlir/lib/Transforms/Utils/RegionUtils.cpp
    M mlir/test/lib/IR/TestOperationEquals.cpp

  Log Message:
  -----------
  [mlir][transforms] Simplify OperationEquivalence and CSE

Replace `mapOperands` and `mapResults` with two new callbacks. It was not clear what "mapping" meant and why the equivalence relationship was a property of the Operand/OpResult as opposed to just SSA values.

This revision changes the contract of the two callbacks: `checkEquivalent` compares two values for equivalence. `markEquivalent` informs the caller that the analysis determined that two values are equivalent. This simplifies the API because callers do not have to reason about operands/results, but just SSA values.

`OperationEquivalence::isEquivalentTo` can be used directly in CSE and there is no need for a custom op equivalence analysis.

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




More information about the All-commits mailing list