Skip to content

Handle OperandOwnerhip::NonUse in PrunedLiveness::computeSSALiveness. #61145

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

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Sep 15, 2022

Fixes a bug in the simple PrunedLiveness routine for SSA values.

Without this fix, the init_existential_ref instruction below was not considered a lifetime-ending use because the non-use type dependednt operand (which is not really an operand at all) would override the forwarding operand:

%1 = open_existential_ref %0 : $any P to $@opened("...", any P) Self
%2 = init_existential_ref %1 : $@opened("...", any P) Self : $@opened("...", any P) Self, $AnyObject

This will be tested by silgen_cleanup_complete_ossa.sil.

The test is on a branch. It isn't possible to commit it until we use this utility in more interesting places. But I want to make sure fixing it doesn't disrupt anything first.

Fixes a bug in the simple PrunedLiveness routine for SSA values.

Without this fix, the init_existential_ref instruction below was not
considered a lifetime-ending use because the non-use type dependednt
operand (which is not really an operand at all) would override the
forwarding operand:

  %1 = open_existential_ref %0 : $any P to $@opened("...", any P) Self
  %2 = init_existential_ref %1 : $@opened("...", any P) Self : $@opened("...", any P) Self, $AnyObject

This will be tested by silgen_cleanup_complete_ossa.sil.
@atrick atrick requested a review from meg-gupta September 15, 2022 22:40
@atrick
Copy link
Contributor Author

atrick commented Sep 15, 2022

@swift-ci test

@meg-gupta
Copy link
Contributor

LGTM

@atrick atrick merged commit 4b361d5 into swiftlang:main Sep 16, 2022
@atrick atrick deleted the ossa-nonuse-liveness branch September 16, 2022 16:35
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