Repository navigation
Add scf.execute_region guard in conversion passes - #3238
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3238 +/- ##
=======================================
Coverage 95.63% 95.63%
=======================================
Files 177 177
Lines 21138 21138
Branches 2124 2124
=======================================
Hits 20216 20216
Misses 727 727
Partials 195 195 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…aringControlOpsError
paul0403
reviewed
Sep 29, 2026
paul0403
reviewed
Sep 29, 2026
kipawaa
reviewed
Sep 30, 2026
kipawaa
left a comment
Contributor
There was a problem hiding this comment.
Nice work! Just one small request before I approve :)
paul0403
reviewed
Sep 30, 2026
Co-authored-by: Paul <[email protected]>
Co-authored-by: Paul <[email protected]>
paul0403
reviewed
Sep 30, 2026
paul0403
reviewed
Sep 30, 2026
paul0403
approved these changes
Oct 1, 2026
kipawaa
approved these changes
Oct 1, 2026
kipawaa
left a comment
Contributor
There was a problem hiding this comment.
Looks good, thanks @hsajjad14!
Co-authored-by: Paul <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context:
In
convert-to-reference-semanticspassscf.execute_regionis causing a crash because it is not implemented. When the region ops were walked,scf.yieldcontinues pointing at a deleted gate's result which causes a crash.(crash log is in shortcut story)
Description of the Change:
Added a guard
ensureNoScfExecuteRegionOpsinconvert-to-reference-semanticsandconvert-to-value-semanticspass which checks if the Op is ascf::ExecuteRegionOpand bails out before walking the region and crashing.Added tests:
mlir/test/Quantum/SemanticsConversion/TestScf.mlir
mlir/test/QRef/SemanticConversion/TestScf.mlir
Benefits:
Needed to migrate
control-Loweringpass to reference semantics.Possible Drawbacks:
Related GitHub Issues:
[sc-130940]