Skip to content

Emit spec compliant QIR #2590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Emit spec compliant QIR #2590

wants to merge 6 commits into from

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented Jul 11, 2025

This updates the QIR code generation logic to comply with the Base and Adaptive Profile specifications. In particular, it makes the following updates:

  • The entry point function returns i64.
  • Module level flags for computation extensions are updated to be consistent with spec fixes for LLVM flags.
  • QIR now includes global strings in the data section that are used as tags for the output recording calls, with tag values chosen to be consistent with the Azure Quantum service output translation.
  • The __quantum__qis__read_result__body function is renamed to __quantum__rt__read_result.
  • Every program begins with a call to the __quantum__rt__initialize function.

@swernli swernli mentioned this pull request Jul 3, 2025
6 tasks
@swernli
Copy link
Collaborator Author

swernli commented Jul 11, 2025

Of note, in case it is helpful for review, the first five commits correspond (mostly) to the bullet points in the description. Commits after that may cover other integration work.

@swernli swernli force-pushed the swernli/qir-spec-compliance branch 2 times, most recently from 9791517 to bf5e1ff Compare July 18, 2025 21:45
@swernli swernli force-pushed the swernli/qir-spec-compliance branch from bf5e1ff to 1250f7f Compare August 4, 2025 06:00
@swernli swernli linked an issue Aug 4, 2025 that may be closed by this pull request
6 tasks
@swernli swernli marked this pull request as ready for review August 4, 2025 16:31
@@ -728,8 +728,8 @@ fn get_module_metadata(program: &rir::Program) -> String {
let name = "int_computations";
writeln!(
flags,
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably worth a note of what 5 means. Or introduce an enum that impls From<i64>.

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.

QIR Specification Compliance
2 participants