[all-commits] [llvm/llvm-project] 008c0e: [DDR] Introduce implicit equality check for the so...

Roman Dzhabarov via All-commits all-commits at lists.llvm.org
Wed Oct 14 11:05:49 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 008c0ea6a4115101694aab0451c89754dee1a5de
      https://github.com/llvm/llvm-project/commit/008c0ea6a4115101694aab0451c89754dee1a5de
  Author: rdzhabarov <rdzhabarov at google.com>
  Date:   2020-10-14 (Wed, 14 Oct 2020)

  Changed paths:
    M mlir/include/mlir/TableGen/Pattern.h
    M mlir/lib/TableGen/Pattern.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/mlir-tblgen/pattern.mlir
    M mlir/tools/mlir-tblgen/RewriterGen.cpp

  Log Message:
  -----------
  [DDR] Introduce implicit equality check for the source pattern operands with the same name.

This CL allows user to specify the same name for the operands in the source pattern which implicitly enforces equality on operands with the same name.
E.g., Pat<(OpA $a, $b, $a) ... > would create a matching rule for checking equality for the first and the last operands. Equality of the operands is enforced at any depth, e.g., OpA ($a, $b, OpB($a, $c, OpC ($a))).

Example usage: Pat<(Reshape $arg0, (Shape $arg0)), (replaceWithValue $arg0)>

Note, this feature only covers operands but not attributes.
Current use cases are based on the operand equality and explicitly add the constraint into the pattern. Attribute equality will be worked out on the different CL.

Reviewed By: jpienaar

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




More information about the All-commits mailing list