Skip to content

[MLIR] Support control flow ops in the ctrl-lowering pass - #3096

Merged
maliasadi merged 35 commits into
mainfrom
ctrl-lowering-scf
Aug 12, 2026
Merged

maliasadi merged 35 commits into
mainfrom
ctrl-lowering-scf

Conversation

@maliasadi

@maliasadi maliasadi commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

Context:
Add support for scf ops in quantum.ctrl regions and the ctrl-lowering pass following the quantum.adjoint / adjoint-lowering support for scf.if, scf.for, scf.while, scf.index_switch ops

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:
[sc-125409]

@maliasadi
maliasadi requested review from kipawaa and paul0403 August 5, 2026 02:41

@paul0403 paul0403 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks @maliasadi !

No major comments from me, other than mentioning again that this would be stupidly easy in reference semantics, especially with scf since in reference semantics all scf regions are just grabbing SSA qref.bit/reg values from above via clousure, and the semantics conversion pass handles all quantum value threading through scf for you!

Comment thread mlir/test/Quantum/CtrlScfTest.mlir Resolved

@kipawaa kipawaa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @maliasadi!

Base automatically changed from ctrl-lowering-nested to main August 12, 2026 20:23
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.67%. Comparing base (9ba2f74) to head (3e898cd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3096      +/-   ##
==========================================
- Coverage   97.23%   96.67%   -0.56%     
==========================================
  Files          40      166     +126     
  Lines        4522    19171   +14649     
  Branches        0     1822    +1822     
==========================================
+ Hits         4397    18534   +14137     
- Misses        125      475     +350     
- Partials        0      162     +162     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maliasadi
maliasadi merged commit 2bde27d into main Aug 12, 2026
37 checks passed
@maliasadi
maliasadi deleted the ctrl-lowering-scf branch August 12, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants