[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Turn op creation into `IRRewrite` (PR #81759)

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


================
@@ -2549,10 +2572,15 @@ LogicalResult OperationConverter::legalizeConvertedArgumentTypes(
     });
     return liveUserIt == val.user_end() ? nullptr : *liveUserIt;
   };
-  for (auto &r : rewriterImpl.rewrites)
-    if (auto *rewrite = dyn_cast<BlockTypeConversionRewrite>(r.get()))
-      if (failed(rewrite->materializeLiveConversions(findLiveUser)))
+  // Note: `rewrites` may be reallocated as the loop is running.
+  for (int64_t i = 0; i < rewriterImpl.rewrites.size(); ++i) {
----------------
jpienaar wrote:

Range based? (yeah seems I'm focussed on loops this morning :))

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


More information about the llvm-branch-commits mailing list