KEMBAR78
Fix bug in `memtoreg` pass with classical values in `if`s by atgeller · Pull Request #1905 · NVIDIA/cuda-quantum · GitHub
Skip to content

Conversation

@atgeller
Copy link
Contributor

@atgeller atgeller commented Jul 9, 2024

Description

There was a small bug in the memtoreg pass where non-linear classical values would incorrectly result in additional arguments being added to the then and else blocks of if statements due to a missing check. This PR adds the missing check, as well as a test case based on the below example, to address this bug.

Example:

cudaq::qubit q;
int i = 0;

if (true) {
  x(q);
  i = 1;
}

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jul 9, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@schweitzpgi
Copy link
Collaborator

schweitzpgi commented Jul 9, 2024

/ok to test

Command Bot: Processing...

Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for finding and fixing this, Adam.

@schweitzpgi
Copy link
Collaborator

schweitzpgi commented Jul 9, 2024

/ok to test

Command Bot: Processing...

@schweitzpgi schweitzpgi enabled auto-merge (squash) July 9, 2024 21:40
@schweitzpgi schweitzpgi merged commit cdd74ea into NVIDIA:main Jul 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2024
@bettinaheim bettinaheim added the bug fix To be listed under Bug Fixes in the release notes label Jul 29, 2024
@bettinaheim bettinaheim added this to the release 0.8.0 milestone Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug fix To be listed under Bug Fixes in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants