Skip to content

Introduce QIR v2.1 Profile Adaptive_RIFLA#3037

Open
swernli wants to merge 5 commits intomainfrom
swernli/adaptive-rifla
Open

Introduce QIR v2.1 Profile Adaptive_RIFLA#3037
swernli wants to merge 5 commits intomainfrom
swernli/adaptive-rifla

Conversation

@swernli
Copy link
Copy Markdown
Collaborator

@swernli swernli commented Mar 20, 2026

This change introduces a new QIR profile, Adaptive_RIFLA, which targets the upcoming QIR v2.1 specification This profile builds from the Integer and Float computations supported by Adaptive_RIF and adds flags for Loops (backwards branching) and Arrays. Note that this PR does not include actual codegen support for these features, but the flags are specified in the template in advance of that work. Adaptive_RIFLA is intended to be in preview/experimental and is not configured as a default (opt-in only).

This PR includes the following changes:

  • Adds the Adaptive_RIFLA profile to as a recognized profile for Q# and OpenQASM
  • Adds the profile to Python enum
  • Adds new v2 codegen for QIR that uses opaque pointers, updated LLVM pattterns, and updated module flags
  • Updates the RIR data structures to introduce new AdvancedInstr struct to capture instructions that are only supported in the new profile.
  • Adds Load and Alloca advanced instructions to complement the existing Store instruction
  • Adds an RIR pass that prunes most extraneous store instructions to identify the required set of variables and values
  • Adds an RIR pass that adds the necessary Load and Alloca instructions to support stack-based variable management
  • Adds test cases for new RIR passes, v2 instructions, and integration tests verifying QIR generation and execution via qir-runner.

Base automatically changed from swernli/support-qir-convert to main March 20, 2026 17:12
This change introduces a new QIR profile, `Adaptive_RIFLA`, which targets the upcoming QIR v2.1 specification
This profile builds from the Integer and Float computations supported by `Adaptive_RIF` and adds flags for
Loops (backwards branching) and Arrays. Note that this PR does not include actual codegen support for these features,
but the flags are specified in the template in advance of that work. `Adaptive_RIFLA` is intended to be in preview/experimental
and is not configured as a default (opt-in only).

This PR includes the following changes:
- Adds the `Adaptive_RIFLA` profile to as a recognized profile for Q# and OpenQASM
- Adds the profile to Python enum
- Adds new v2 codegen for QIR that uses opaque pointers, updated LLVM pattterns, and updated module flags
- Updates the RIR data structures to introduce new `AdvancedInstr` struct to capture instructions that are only supported
in the new profile.
- Adds `Load` and `Alloca` advanced instructions to complement the existing `Store` instruction
- Adds an RIR pass that prunes most extraneous store instructions to identify the required set of variables and values
- Adds an RIR pass that adds the necessary `Load` and `Alloca` instructions to support stack-based variable management
- Adds test cases for new RIR passes, v2 instructions, and integration tests verifying QIR generation and execution via qir-runner.
@swernli swernli force-pushed the swernli/adaptive-rifla branch from 964cde0 to 4d330f4 Compare March 20, 2026 18:10
@swernli swernli marked this pull request as ready for review March 20, 2026 18:11
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.

2 participants