llvm-capstone/mlir
Chris Lattner 6874726610 [PatternMatching] Add convenience insert method to OwningRewritePatternList. NFC.
This allows adding a C function pointer as a matchAndRewrite style pattern, which
is a very common case.  This adopts it in ExpandTanh to show how it reduces a level
of nesting.

We could allow C++ lambdas here, but that doesn't work as well with type inference
in the common case.  Instead of:

  patterns.insert(convertTanhOp);

you need to specify:

  patterns.insert<math::TanhOp>(convertTanhOp);

which is boilerplate'y.  Capturing state like this is very uncommon, so we choose
to require clients to define their own structs and use the non-convenience method
when they need to do so.

Differential Revision: https://reviews.llvm.org/D99039
2021-03-22 11:18:21 -07:00
..
cmake/modules [mlir][python] Reorganize MLIR python into namespace packages. 2021-03-08 23:01:34 -08:00
docs [PatternMatching] Add convenience insert method to OwningRewritePatternList. NFC. 2021-03-22 11:18:21 -07:00
examples Update examples post OwningRewritePatternList change 2021-03-21 15:15:54 -07:00
include [PatternMatching] Add convenience insert method to OwningRewritePatternList. NFC. 2021-03-22 11:18:21 -07:00
lib [PatternMatching] Add convenience insert method to OwningRewritePatternList. NFC. 2021-03-22 11:18:21 -07:00
test Fix the order of directives and the target string 2021-03-22 11:10:12 -07:00
tools Remove the extraneous MLIRContext argument from populateWithGenerated. NFC. 2021-03-21 10:38:35 -07:00
unittests Change OwningRewritePatternList to carry an MLIRContext with it. 2021-03-21 10:06:31 -07:00
utils [mlir] Add simple jupyter kernel 2021-02-21 18:16:06 -08:00
.clang-format
.clang-tidy Fix MLIR clang-tidy: when tweaking it does not inherit from the parent 2020-03-07 17:44:21 +00:00
CMakeLists.txt [CMake] Require python 3.6 if enabling LLVM test targets 2021-03-15 09:50:39 -07:00
LICENSE.TXT Add the Apache2 with LLVM exceptions license to MLIR 2019-12-24 00:58:06 -08:00
README.md mlir README.md: Fix the syntax 2019-12-24 13:31:07 +01:00

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.