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
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
.clang-format
.clang-tidy
CMakeLists.txt [CMake] Require python 3.6 if enabling LLVM test targets 2021-03-15 09:50:39 -07:00
LICENSE.TXT
README.md

Multi-Level Intermediate Representation

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