-
Notifications
You must be signed in to change notification settings - Fork 174
Ref count optimizations and some bug fixes #982
Conversation
swernli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test QIR looks good and the logic is sound, so approving. We will have to rely on manual testing for runtime behavior for now.
src/QsCompiler/QirGeneration/Subtransformations/ExpressionKindTransformation.cs
Outdated
Show resolved
Hide resolved
…Transformation.cs Co-authored-by: Stefan J. Wernli <[email protected]>
Yes, I did some manual validation locally, but of course not nearly as extensive as a proper CI setup should be - let's push to get the full CI up and running. |
This reverts commit 9689a96.
* Revert "Fixing an issue where reference count increases were not applied in certain cases (#987)" This reverts commit ed60c81. * Revert "Splitting out general purpose helpers for branches and loops that yield values (#985)" This reverts commit 34bd1fe. * Revert "Ref count optimizations and some bug fixes (#982)" This reverts commit 9689a96. Co-authored-by: Bettina Heim <[email protected]>
|
Very briefly outlining the issue that this PR ran into and that I overlooked initially: |
This PR switches to apply ref count changes only to the outer container and not the inner items unless the ref count changes are due to an assignment to a mutable variable. The reasoning is that I believe it is not possible for an inner item to ever go out of scope earlier than the container unless it is assigned to a mutable variable somewhere.
This PR makes the adjustment in #859 unnecessary (i.e. incorrect), and fixes #970. I believe it may also possibly fix some of #981 (tbd, I think there are possibly multiple issues there).