aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorMatthias Springer <me@m-sp.org>2024-02-23 09:48:13 +0100
committerGitHub <noreply@github.com>2024-02-23 09:48:13 +0100
commitd68d29516102252f6bf6dc23fb22cef144ca1cb3 (patch)
treea241798b7ed472a3eae3e371633e8ba993d331f0 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent5ca877591e65acf18b5a8d3234ff88b215b4f369 (diff)
downloadllvm-d68d29516102252f6bf6dc23fb22cef144ca1cb3.zip
llvm-d68d29516102252f6bf6dc23fb22cef144ca1cb3.tar.gz
llvm-d68d29516102252f6bf6dc23fb22cef144ca1cb3.tar.bz2
[mlir][Transforms][NFC] Turn op/block arg replacements into `IRRewrite`s (#81757)
This commit is a refactoring of the dialect conversion. The dialect conversion maintains a list of "IR rewrites" that can be committed (upon success) or rolled back (upon failure). Until now, op replacements and block argument replacements were kept track in separate data structures inside the dialect conversion. This commit turns them into `IRRewrite`s, so that they can be committed or rolled back just like any other rewrite. This simplifies the internal state of the dialect conversion. Overview of changes: * Add two new rewrite classes: `ReplaceBlockArgRewrite` and `ReplaceOperationRewrite`. Remove the `OpReplacement` helper class; it is now part of `ReplaceOperationRewrite`. * Simplify `RewriterState`: `numReplacements` and `numArgReplacements` are no longer needed. (Now being kept track of by `numRewrites`.) * Add `IRRewrite::cleanup`. Operations should not be erased in `commit` because they may still be referenced in other internal state of the dialect conversion (`mapping`). Detaching operations is fine. * `trackedOps` are now updated during the "commit" phase instead of after applying all rewrites.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions