Skip to content

🐛 Lower control-flow assertions to QIR - #1933

Merged
burgholzer merged 3 commits into
mainfrom
agent/1910-qir-assert
Jul 24, 2026
Merged

🐛 Lower control-flow assertions to QIR#1933
burgholzer merged 3 commits into
mainfrom
agent/1910-qir-assert

Conversation

@burgholzer

@burgholzer burgholzer commented Jul 24, 2026

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Summary

  • Register MLIR's canonical cf.assert-to-LLVM conversion in both QIR profiles.
  • Cover Base and Adaptive QIR lowering with native assertion regression tests.
  • Split compiler QIR work into a dedicated changelog entry and remove QIR-only
    PRs from the generic QC/QCO infrastructure entry.

Context

This general QIR gap was found while working on the OpenQASM integration in
#1910. OpenQASM runtime preconditions can be represented as cf.assert; the
standard QC → QCO → QC → QIR pipeline should lower those assertions instead of
rejecting otherwise valid IR. The fix uses MLIR's existing conversion rather
than introducing OpenQASM-specific handling.

The changelog entry collects the compiler QIR work that was previously mixed
into the generic infrastructure entry. PRs that also affected QC, QCO, Jeff, or
broader compiler infrastructure remain listed in both relevant entries;
QIR-only PRs are moved to the QIR entry.

Validation

  • QIR Base conversion tests: 111 passed
  • QIR Adaptive conversion tests: 129 passed
  • uvx prek run --from-ref origin/main --to-ref HEAD
  • git diff --check origin/main...HEAD

Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6 via Codex
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@burgholzer burgholzer self-assigned this Jul 24, 2026
@burgholzer burgholzer added enhancement Improvement of existing feature c++ Anything related to C++ code MLIR Anything related to MLIR labels Jul 24, 2026
@burgholzer burgholzer added this to the MLIR Support milestone Jul 24, 2026
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
@burgholzer
burgholzer marked this pull request as ready for review July 24, 2026 12:32
@burgholzer
burgholzer enabled auto-merge (squash) July 24, 2026 12:32
@burgholzer
burgholzer merged commit 7063cf1 into main Jul 24, 2026
29 checks passed
@burgholzer
burgholzer deleted the agent/1910-qir-assert branch July 24, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Anything related to C++ code enhancement Improvement of existing feature MLIR Anything related to MLIR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant