[Mlir-commits] [mlir] [mlir][Transforms] Deactivate `replaceAllUsesWith` in dialect conversion (PR #154112)

Matthias Springer llvmlistbot at llvm.org
Mon Aug 18 06:04:00 PDT 2025


================
@@ -538,15 +538,16 @@ struct ParallelOpLowering : public OpRewritePattern<scf::ParallelOp> {
 
 /// Applies the conversion patterns in the given function.
 static LogicalResult applyPatterns(ModuleOp module, unsigned numThreads) {
-  ConversionTarget target(*module.getContext());
-  target.addIllegalOp<scf::ReduceOp, scf::ReduceReturnOp, scf::ParallelOp>();
-  target.addLegalDialect<omp::OpenMPDialect, LLVM::LLVMDialect,
-                         memref::MemRefDialect>();
-
   RewritePatternSet patterns(module.getContext());
   patterns.add<ParallelOpLowering>(module.getContext(), numThreads);
   FrozenRewritePatternSet frozen(std::move(patterns));
-  return applyPartialConversion(module, target, frozen);
+  walkAndApplyPatterns(module, frozen);
----------------
matthias-springer wrote:

This change was needed because the pattern uses `replaceAllUsesWith`.

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


More information about the Mlir-commits mailing list