Skip to content

[6.4.1] LoopInvariantCodeMotion: don't hoist and sink store [assign] - #92506

Merged
eeckstein merged 1 commit into
swiftlang:release/6.4.1from
eeckstein:fix-licm-6.4.1
Sep 22, 2026
Merged

eeckstein merged 1 commit into
swiftlang:release/6.4.1from
eeckstein:fix-licm-6.4.1

Conversation

@eeckstein

Copy link
Copy Markdown
Contributor

This was accidentally enabled by 4114b28, which moved the collection of
`loadsAndStores` from `collectMovableInstructions` (where stores with an `assign`
ownership were filtered out) to the new `collectSpeculativelyMovableInstructions`,
which doesn't filter at all.

`hoistAndSinkLoadAndStore` doesn't support `store [assign]`: it erases the store
without destroying the overwritten value, which leaks the value coming from the
SSAUpdater's phi argument Reject such access paths in `isOnlyLoadedAndStored` again
and remove the now dead ownership check in `collectMovableInstructions`.

Fixes an ownership verifier error
rdar://183953843

(cherry picked from commit 3f5c32d)
@eeckstein
eeckstein requested a review from a team as a code owner September 22, 2026 06:07
@eeckstein eeckstein changed the title LoopInvariantCodeMotion: don't hoist and sink store [assign] [6.4.1] LoopInvariantCodeMotion: don't hoist and sink store [assign] Sep 22, 2026
@eeckstein

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@eeckstein
eeckstein merged commit 703413c into swiftlang:release/6.4.1 Sep 22, 2026
6 checks passed
@eeckstein
eeckstein deleted the fix-licm-6.4.1 branch September 22, 2026 20:11
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