diff options
author | Markus Böck <markus.boeck02@gmail.com> | 2022-12-25 19:29:31 +0100 |
---|---|---|
committer | Markus Böck <markus.boeck02@gmail.com> | 2023-01-11 14:32:21 +0100 |
commit | bbfa7ef16dd9900b36abfa1a5f2faddb81afeb51 (patch) | |
tree | 3639e00eaaabccfb705bfa6bccdd9aaf7dc47c5d /llvm/tools/llvm-reduce/llvm-reduce.cpp | |
parent | cf6f21751622fcae326d1fe13bc5afd74c4e720f (diff) | |
download | llvm-bbfa7ef16dd9900b36abfa1a5f2faddb81afeb51.zip llvm-bbfa7ef16dd9900b36abfa1a5f2faddb81afeb51.tar.gz llvm-bbfa7ef16dd9900b36abfa1a5f2faddb81afeb51.tar.bz2 |
[mlir] Add a new fold API using Generic Adaptors
This is part of the RFC for a better fold API: https://discourse.llvm.org/t/rfc-a-better-fold-api-using-more-generic-adaptors/67374
This patch implements the required foldHook changes and the TableGen machinery for generating `fold` method signatures using `FoldAdaptor` for ops, based on the value of `useFoldAPI` of the dialect. It may be one of 2 values, with convenient named constants to create a quasi enum. The new `fold` method will then be generated if `kEmitFoldAdaptorFolder` is used.
Since the new `FoldAdaptor` approach is strictly better than the old signature, part of this patch updates the documentation and all example to encourage use of the new `fold` signature.
Included are also tests exercising the new API, ensuring proper construction of the `FoldAdaptor` and proper generation by TableGen.
Differential Revision: https://reviews.llvm.org/D140886
Diffstat (limited to 'llvm/tools/llvm-reduce/llvm-reduce.cpp')
0 files changed, 0 insertions, 0 deletions