Skip to content

Conversation

@nate-chandler
Copy link
Contributor

The pass rewrites unchecked_take_enum_data_addr whose uses are all loads as loads--with the same ownership--of the base followed by unchecked_enum_datas. If the base is noncopyable and any of the loads are load [copy], performing this transformation would result in a copy of that noncopyable base, which is invalid. So bail if the base is noncopyable and any of the loads are load [copy]s.

rdar://156543855

The pass rewrites `unchecked_take_enum_data_addr` whose uses are all
loads as loads--with the same ownership--of the base followed by
`unchecked_enum_data`s.  If the base is noncopyable and any of the loads
are `load [copy]`, performing this transformation would result in a
copy of that noncopyable base, which is invalid.  So bail if the base is
noncopyable and any of the loads are `load [copy]`s.

rdar://156543855
@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 nate-chandler changed the title [SILCombine] Bail from combine of load-only unchecked_take_enum_data_addr with noncopyable base. [SILCombine] Skip load-only unchecked_take_enum_data_addr with noncopyable base. Jul 29, 2025
@nate-chandler nate-chandler marked this pull request as ready for review July 30, 2025 00:14
@nate-chandler nate-chandler enabled auto-merge July 30, 2025 00:14
@nate-chandler
Copy link
Contributor Author

@swift-ci please test macos platform

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.

Makes sense

@nate-chandler
Copy link
Contributor Author

@swift-ci please test macos platform

@nate-chandler nate-chandler merged commit 70aa18a into swiftlang:main Jul 31, 2025
6 of 8 checks passed
@nate-chandler nate-chandler deleted the rdar156543855 branch July 31, 2025 03:41
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