llvm-project/mlir/tools
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
..
mlir-cpu-runner [mlir] Make mlir-cpu-runner depend on native instead of X86 2020-11-30 15:11:34 +00:00
mlir-cuda-runner [mlir] Add gpu.allocate, gpu.deallocate ops with LLVM lowering to runtime function calls. 2020-11-27 09:40:59 +01:00
mlir-linalg-ods-gen [mlir][linalg] Start a named ops to generic ops pass 2020-11-19 09:21:06 -05:00
mlir-opt [mlir][PDL] Add support for PDL bytecode and expose PDL support to OwningRewritePatternList 2020-12-01 15:05:50 -08:00
mlir-reduce [mlir] Fix missing namespaces in OpBuildGen.cpp 2020-11-05 18:11:01 +01:00
mlir-rocm-runner [mlir] Add gpu.allocate, gpu.deallocate ops with LLVM lowering to runtime function calls. 2020-11-27 09:40:59 +01:00
mlir-shlib [MLIR] Reapply: Adjust libMLIR building to more closely follow libClang 2020-05-04 20:47:57 -07:00
mlir-spirv-cpu-runner [mlir] Fix stack-use-after-scope in cuda/vulkan cpu runners 2020-10-27 17:26:08 -07:00
mlir-tblgen [mlir][OpDefGen] Add support for generating local functions for shared utilities 2020-12-14 14:21:30 -08:00
mlir-translate Revert "[RFC] Factor out repetitive cmake patterns for llvm-style projects" 2020-10-04 15:17:34 -07:00
mlir-vulkan-runner [mlir] Fix stack-use-after-scope in cuda/vulkan cpu runners 2020-10-27 17:26:08 -07:00
CMakeLists.txt [MLIR][mlir-spirv-cpu-runner] A SPIR-V cpu runner prototype 2020-10-26 09:09:29 -04:00