Skip to content

Disable a few mark_dependence sil combines in ossa #68395

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
Sep 11, 2023

Conversation

meg-gupta
Copy link
Contributor

There are 2 reasons to disable this:

  1. OSSA rauw creates copies for replacement, copies created in this case cannot be canonicalized away due to the presence of pointer escape. (See test test_mark_dependence_ossa_silcombine1 after -sil-combine -copy-propagation)

  2. SILCombine of mark_dependence (enum can cause a potential miscompile.

ClosureLifetimeFixup specifically inserts enums to lifetime extend the closure lifetime until the end of the function. Replacing mark_dependence's base operand with a copy of the enum's operand can end up shortening the lifetime of the base. (See test test_mark_dependence_ossa_silcombine2 after -sil-combine -dce -semantic-arc-opts)

Fixes rdar://115139907 and rdar://114615539

@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta
Copy link
Contributor Author

@swift-ci apple silicon benchmark

@meg-gupta
Copy link
Contributor Author

@swift-ci test

There are 2 reasons to disable this:

1. OSSA rauw creates copies for replacement, copies created in this case
cannot be canonicalized away due to the presence of pointer escape.
(See test test_mark_dependence_ossa_silcombine1 after -sil-combine -copy-propagation)

2. SILCombine of mark_dependence (enum can cause a potential miscompile.

ClosureLifetimeFixup specifically inserts enums to lifetime extend the closure
lifetime until the end of the function. Replacing mark_dependence's base operand
with a copy of the enum's operand can end up shortening the lifetime of the base.
(See test test_mark_dependence_ossa_silcombine2 after -sil-combine -dce -semantic-arc-opts)
@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.

LGTM. Thanks for fixing these

@meg-gupta meg-gupta merged commit 047ffd5 into swiftlang:main Sep 11, 2023
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