✨ Support reusable QC functions in QIR output - #2340
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
burgholzer
force-pushed
the
codex/qir-reusable-functions
branch
2 times, most recently
from
September 3, 2026 03:49
ba4e07d to
7debc7d
Compare
12 tasks
burgholzer
force-pushed
the
codex/jeff-reusable-functions
branch
from
September 3, 2026 05:07
c2f0894 to
f6c4ccc
Compare
burgholzer
force-pushed
the
codex/qir-reusable-functions
branch
from
September 3, 2026 05:07
7debc7d to
763fafc
Compare
12 tasks
burgholzer
force-pushed
the
codex/jeff-reusable-functions
branch
from
September 3, 2026 23:12
f6c4ccc to
aa96714
Compare
burgholzer
force-pushed
the
codex/qir-reusable-functions
branch
from
September 3, 2026 23:12
763fafc to
6b1d409
Compare
12 tasks
burgholzer
force-pushed
the
codex/jeff-reusable-functions
branch
from
September 4, 2026 21:59
aa96714 to
212d319
Compare
burgholzer
force-pushed
the
codex/qir-reusable-functions
branch
2 times, most recently
from
September 5, 2026 13:09
01dce46 to
d0936e5
Compare
burgholzer
force-pushed
the
codex/jeff-reusable-functions
branch
2 times, most recently
from
September 5, 2026 15:00
29543df to
b74fd6a
Compare
burgholzer
force-pushed
the
codex/qir-reusable-functions
branch
from
September 5, 2026 15:00
d0936e5 to
0d4f103
Compare
Flatten reusable calls only at QIR output boundaries using MLIR's stock inliner and the existing phase, modifier, and canonicalization passes. Register promised inliner interfaces for compiler-owned and adopted contexts, and expose QCO helpers before QIR-bound optimization. Assisted-by: Codex
burgholzer
force-pushed
the
codex/qir-reusable-functions
branch
from
September 6, 2026 10:39
0d4f103 to
a05c17f
Compare
burgholzer
commented
Sep 6, 2026
burgholzer
left a comment
Member
Author
There was a problem hiding this comment.
This also feels very clean. Getting this in ![]()
burgholzer
enabled auto-merge (squash)
September 6, 2026 10:54
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.
🤖 AI text below 🤖
Description
Prepare reusable functions for Base and Adaptive QIR with the stock MLIR inliner. Coordinated QIR output inlines before QCO optimization so existing synthesis can reduce compound helpers, then normalizes global phases, unrolls modifiers, and canonicalizes before QIR conversion.
This PR is stacked on #2339 and follows the current Programs/Pipeline library split. QC, QCO, and jeff routes retain ordinary reusable calls. Unsynthesized shared-wire compound powers remain unsupported; no unsafe power distribution or call-specific QIR lowering is added.
Compiler-created and caller-owned typed-program contexts receive the standard Func/LLVM inliner extensions. Regressions cover the public textual
inlinepipeline and the controlled-power numeric relative phase.Codex implemented and tested the changes with independent QIR/MLIR specialist review.
Integrated-stack validation: release build; all 3,916 registered CTest cases with one expected skip; all 294 Qiskit translation tests; whole-file C++ lint and repository lint. Stub generation passed without tracked changes. Hosted CI is separate evidence and has not been claimed as passed.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).