aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riddleriver@gmail.com>2020-12-14 14:14:22 -0800
committerRiver Riddle <riddleriver@gmail.com>2020-12-14 14:21:30 -0800
commitb3ee7f1f312dd41a0ac883d78b71c14d96e78939 (patch)
tree9b391465c088a7d747114963676e2098186936bc /clang/lib/Lex/ModuleMap.cpp
parentcf5845d6c428a648b9b6f849122e7acc2db9df21 (diff)
downloadllvm-b3ee7f1f312dd41a0ac883d78b71c14d96e78939.zip
llvm-b3ee7f1f312dd41a0ac883d78b71c14d96e78939.tar.gz
llvm-b3ee7f1f312dd41a0ac883d78b71c14d96e78939.tar.bz2
[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
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions