Skip to content

Handle partial_apply and mark_dependence in Temp RVO #29927

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

Closed
wants to merge 1 commit into from

Conversation

meg-gupta
Copy link
Contributor

partial_apply and mark_dependence do not have any side effects that could block Temp RVO. Handle these additional cases.

@meg-gupta
Copy link
Contributor Author

Supersedes some of the changes in #29812

@meg-gupta
Copy link
Contributor Author

@swift-ci please test

@@ -1873,7 +1877,7 @@ bool TempRValueOptPass::tryOptimizeCopyIntoTemp(CopyAddrInst *copyInst) {
continue;

// Destroys and deallocations are allowed to be in a different block.
if (isa<DestroyAddrInst>(user) || isa<DeallocStackInst>(user))
if (isa<DestroyAddrInst>(user) || isa<DeallocStackInst>(user) || isa<MarkDependenceInst>(user))
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we have to check the uses of the mark_dependence instruction?

Copy link
Contributor Author

@meg-gupta meg-gupta Feb 19, 2020

Choose a reason for hiding this comment

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

You are right. Looks like I do need to look at its uses. And one of its uses is another partial_apply which is marked as having side effects in AliasAnalysis.

@meg-gupta
Copy link
Contributor Author

Closing this PR. The pattern I was trying to optimize shouldn't be generated in SIL in the first place.

@meg-gupta meg-gupta closed this Feb 21, 2020
@meg-gupta meg-gupta deleted the copyforwardingfix branch February 21, 2020 16:51
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