Skip to content

Fix hoisting array semantics call with non-dominant self in ossa #79644

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
Feb 27, 2025

Conversation

meg-gupta
Copy link
Contributor

If we have a self value that does not dominate loop preheader, and the array semantics call does not consume the self value, that means there will be instructions that consume the self value within the loop.

In ossa, we cannot hoist such semantic calls because there is no support for creating destroys for them in the preheader. Add a bailout to avoid the ownership error.

rdar://145673368

@meg-gupta meg-gupta marked this pull request as ready for review February 26, 2025 20:00
@meg-gupta meg-gupta requested a review from eeckstein as a code owner February 26, 2025 20:00
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta changed the title Fix hoisting array semantics call with non-dominant self Fix hoisting array semantics call with non-dominant self in ossa Feb 26, 2025
Copy link
Contributor

@nate-chandler nate-chandler left a comment

Choose a reason for hiding this comment

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

lgtm

@meg-gupta
Copy link
Contributor Author

I'll create a follow up PR to create be able to hoist such self values. This will be important for performance reasons in such cases.

If we have a self value that does not dominate loop preheader,
and the array semantics call does not consume the self value,
that means there will be instructions that consume the self value
with the loop.

In ossa, we cannot hoist such semantic calls because there is no
support for creating destroys for them in the preheader.
Add a bailout to avoid the ownership error.

rdar://145673368
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta
Copy link
Contributor Author

@swift-ci test macOS platform

@meg-gupta meg-gupta merged commit b795228 into swiftlang:main Feb 27, 2025
5 checks passed
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