Skip to content

Update guaranteed forwarding phi apis and verification #62454

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 3 commits into from
Dec 14, 2022

Conversation

meg-gupta
Copy link
Contributor

@meg-gupta meg-gupta commented Dec 8, 2022

  • Delete isGuaranteedForwardingPhi and update isGuaranteedForwarding
  • Delete OperandOwnership::GuaranteedForwardingPhi, and update uses to OperandOwnership::GuaranteedForwarding
  • Add verification to guaranteed forwarding phis to ensure it has guaranteed forwarding incoming operands on zero or all paths.

@meg-gupta meg-gupta force-pushed the guaranteedforwardingphiverify branch from 4bc29a9 to 9b57f51 Compare December 8, 2022 19:25
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta
Copy link
Contributor Author

@swift-ci 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.

Basically LGTM. Thanks.

If you make another round of changes, then I should merge this first
#62493

return false;
// NOTE: canOpcodeForwardInnerGuaranteedValues returns true for transformation
// terminator results.
if (canOpcodeForwardInnerGuaranteedValues(value) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

I hope we can have a reborrow vs. forwarding flag on the phi soon so we don't need this distinction between "inner" guaranteed values and other guaranteed values! Then I don't think we need this logic.

@@ -623,6 +625,38 @@ bool SILValueOwnershipChecker::isSubobjectProjectionWithLifetimeEndingUses(
});
}

bool SILValueOwnershipChecker::
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for this verification. If we had a reborrow phi flag, then then we wouldn't need any transitive verification at all.

@meg-gupta meg-gupta force-pushed the guaranteedforwardingphiverify branch from 85e456b to 35d45de Compare December 13, 2022 21:24
@meg-gupta
Copy link
Contributor Author

@swift-ci test and merge

@swift-ci swift-ci merged commit 6d0a325 into swiftlang:main Dec 14, 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