Skip to content

Fix OperandOwnership of select_value #61894

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
Nov 7, 2022

Conversation

meg-gupta
Copy link
Contributor

@meg-gupta meg-gupta commented Nov 2, 2022

select_value is supported only on integer types. Fix OperandOwnership to reflect that.

Fixes rdar://101616865

@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

I'm not sure why there was an ownership error before this fix, or why we can't support guaranteed forwarding. It's nice if we can just enforce trivial types, but the value ownership is still guaranteed:
CONSTANT_OR_NONE_OWNERSHIP_INST(Guaranteed, SelectValue)

@meg-gupta
Copy link
Contributor Author

meg-gupta commented Nov 3, 2022

@atrick Before this change we returned OperandOwnership::GuaranteedForwarding for case value operands, causing swift::checkOperandOwnershipInvariants to return false because select_value isn't supported in swift::canOpcodeForwardGuaranteedValues. Since I learnt select_value is intended for integral types only from SIL.rst and SILVerifier::checkSelectValueCases, I am changing it to trivial here.

Also changed the ValueOwnership in the updated version.

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

😎

@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test and merge

1 similar comment
@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 6402bde into swiftlang:main Nov 7, 2022
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.

3 participants