llvm-project/mlir
River Riddle b3ee7f1f31 [mlir][OpDefGen] Add support for generating local functions for shared utilities
This revision adds a new `StaticVerifierFunctionEmitter` class that emits local static functions in the .cpp file for shared operation verification. This class deduplicates shared operation verification code by emitting static functions alongside the op definitions. These methods are local to the definition file, and are invoked within the operation verify methods. The first bit of shared verification is for the type constraints used when verifying operands and results. An example is shown below:

```
static LogicalResult localVerify(...) {
  ...
}

LogicalResult OpA::verify(...) {
  if (failed(localVerify(...)))
    return failure();
  ...
}

LogicalResult OpB::verify(...) {
  if (failed(localVerify(...)))
    return failure();
  ...
}
```

This allowed for saving >400kb of code size from a downstream TensorFlow project (~15% of MLIR code size).

Differential Revision: https://reviews.llvm.org/D91381
2020-12-14 14:21:30 -08:00
..
cmake/modules [mlir] use STATUS instead of CHECK_* in MLIRDetectPythonEnv.cmake 2020-11-25 00:09:33 +01:00
docs [mlir][OpFormat] Add support for emitting newlines from the custom format of an operation 2020-12-14 12:00:43 -08:00
examples [mlir] Use mlir::OpState::operator->() to get to methods of mlir::Operation. This is a preparation step to remove the corresponding methods from OpState. 2020-12-09 12:11:32 +01:00
include [mlir][OpDefGen] Add support for generating local functions for shared utilities 2020-12-14 14:21:30 -08:00
integration_test [mlir][LLVMIR] Add support for InlineAsmOp 2020-11-30 08:32:02 +00:00
lib [mlir][ArmSVE][RFC] Add an ArmSVE dialect 2020-12-14 21:35:01 +00:00
test [mlir][OpDefGen] Add support for generating local functions for shared utilities 2020-12-14 14:21:30 -08:00
tools [mlir][OpDefGen] Add support for generating local functions for shared utilities 2020-12-14 14:21:30 -08:00
unittests [flang] Use mlir::OpState::operator->() to get to methods of mlir::Operation. 2020-12-14 20:04:53 +01:00
utils Revert "Revert "[mlir] Start splitting the `tensor` dialect out of `std`."" 2020-12-11 14:30:50 -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 [mlir][Python] Check numpy in Python bindings configuration. 2020-12-02 09:29:20 +08: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

README.md

Multi-Level Intermediate Representation

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