Skip to content

[OSSACanonicalizeGuaranteed] Don't rewrite consuming uses of move-only values. #78552

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 4 commits into from
Jan 11, 2025

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Jan 10, 2025

When visiting a consuming use of a move-only value (which can be produced by a forwarding operation), the inner rewriter must bail out. Otherwise, it would produce a copy of that move-only value.

This required allowing visitation of function arguments to fail.

rdar://142520491

Replace large nested condition with early exit.
Allow rewriting of arguments to bail out.  This is necessary because not
all forwarding instructions allow rewriting of forward(copy) as
copy(forward) (e.g. when forward produces a move-only value).
When visiting a consuming use of a move-only value (which can be
produced by a forwarding operation), the inner rewriter must bail out.
Otherwise, it would produce a copy of that move-only value.

rdar://142520491
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please apple silicon benchmark

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler
Copy link
Contributor Author

@swift-ci please apple silicon benchmark

@nate-chandler nate-chandler marked this pull request as ready for review January 10, 2025 22:27
Copy link
Contributor

@meg-gupta meg-gupta left a comment

Choose a reason for hiding this comment

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

lgtm

@nate-chandler
Copy link
Contributor Author

Source compat failures match failures in baseline:

Failures:
  FAIL: vapor_apns, 5.10, 98ba2f, Swift Package
  FAIL: fluent, 5.10, dfcbeb, Swift Package
  FAIL: vapor_jwt, 5.10, f240c5, Swift Package
  FAIL: vapor_leaf, 5.10, dd799b, Swift Package
  FAIL: vapor_queues, 5.10, 15829c, Swift Package
  FAIL: vapor_queues-redis-driver, 5.10, 828e28, Swift Package
  FAIL: vapor_redis, 5.10, 383ed5, Swift Package
  FAIL: vapor_template-bare, 5.10, 609c21, Swift Package
  FAIL: vapor_template-fluent-postgres-leaf, 5.10, 89935b, Swift Package

@nate-chandler nate-chandler merged commit 50c4861 into swiftlang:main Jan 11, 2025
7 of 8 checks passed
@nate-chandler nate-chandler deleted the rdar142520491 branch January 11, 2025 01:21
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