[Mlir-commits] [mlir] [MLIR][SCF] Actually use conversion interface in scf-to-cf conversion (PR #154075)

Matthias Springer llvmlistbot at llvm.org
Mon Aug 18 04:54:02 PDT 2025


https://github.com/matthias-springer approved this pull request.

I don't fully understand what causes the crash here, but this PR makes sense to me. Conversion patterns and rewrite patterns do not compose well when running with "rollback enabled". The name of the `populateSCFToControlFlowConversionPatterns` function suggests that these should be conversion patterns.

However, I doubt that whatever crash you're seeing would be fixed by this change. Turning the rewrite patterns into conversion patterns is adding an indicator to the user what kind of things are allowed in the `matchAndRewrite` implementation. But that implementation did not actually change, so I believe this PR is NFC for existing users that populate those patterns in a dialect conversion.

Alternatively, the name of the function could be renamed to `populateSCFToControlFlowPatterns`, and the dialect conversion be replaced with the `walkPatterns` driver.


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


More information about the Mlir-commits mailing list