👷 Lower reusable functions with standard MLIR passes - #2344
Open
burgholzer wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
burgholzer
force-pushed
the
codex/qiskit-reusable-gates
branch
from
September 3, 2026 23:12
afd7d4c to
7fdb302
Compare
burgholzer
force-pushed
the
codex/reusable-function-lowering
branch
from
September 3, 2026 23:12
4007906 to
dd9ae18
Compare
Require a public, defined func.func program entry so standard symbol DCE can prune unreachable private helpers during explicit QC and QCO cleanup. Preserve unused gate declarations during structured QC export. Inline reusable calls once at the target-compilation boundary before mapping, synthesis, and conformance checks. Keep the typed and CLI QIR paths from scheduling a redundant inliner when target compilation owns the lowering. Assisted-by: GPT-5.6 via Codex
burgholzer
force-pushed
the
codex/qiskit-reusable-gates
branch
from
September 4, 2026 21:59
7fdb302 to
6328d48
Compare
burgholzer
force-pushed
the
codex/reusable-function-lowering
branch
from
September 4, 2026 21:59
dd9ae18 to
d1b21bd
Compare
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
Use standard MLIR passes to lower reusable functions for compiler targets. Entry points are public, defined
func.funcoperations, giving symbol liveness an explicit root. Target compilation inlines before decomposition, mapping, synthesis, and conformance checks; a target-selected QIR route avoids duplicate early inlining.This PR is stacked on #2342. Explicit QC and QCO cleanup run symbol DCE after canonicalization, including when folding erases a helper's last call. The QC export pipeline deliberately preserves unused gate declarations that structured formats can represent. Signature-changing dead-value removal stays out of function-preserving cleanup.
No custom IPO framework or interprocedural WireIterator state is added.
qco.callalready exposes positional wire correspondence throughUnitaryOpInterface; genericfunc.callremains an intentional boundary. Codex implemented and tested the changes with independent MLIR/compiler 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).