[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Turn block type conversion into `IRRewrite` (PR #81756)

Jacques Pienaar via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 21 06:21:24 PST 2024


================
@@ -1173,29 +936,110 @@ struct ConversionPatternRewriterImpl : public RewriterBase::Listener {
 } // namespace detail
 } // namespace mlir
 
+void IRRewrite::eraseOp(Operation *op) {
+  rewriterImpl.eraseRewriter.eraseOp(op);
+}
+
+void IRRewrite::eraseBlock(Block *block) {
+  rewriterImpl.eraseRewriter.eraseBlock(block);
+}
+
+void BlockTypeConversionRewrite::commit() {
+  // Process the remapping for each of the original arguments.
+  for (unsigned i = 0, e = origBlock->getNumArguments(); i != e; ++i) {
----------------
jpienaar wrote:

Would llvm::zip work here to enable a range based loop?

https://github.com/llvm/llvm-project/pull/81756


More information about the llvm-branch-commits mailing list