-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SIL: fix bugs in the MemBehavior cache invalidation mechanism. #35263
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
Conversation
@swift-ci test |
Build failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
In the test file, it's not clear how the SIL exposes a corner case. There's no check to indicate what optimization temp-rvalue needs to do to expose the issue.
When a non-value instruction (e.g. a destroy_addr) was deleted, the corresponding cache entry in MemoryBehaviorCache was not invalidated. If a new instruction was allocated at the same memory location, the old - and invalid - cache entry was re-used. This bug triggered a SIL memory lifetime failure in TempRValueElimination. https://bugs.swift.org/browse/SR-13985 rdar://problem/72614608 This change also fixes another problem (which I found by inspection): Individual result values of MultipleValueInstructions were not invalidated correctly.
@swift-ci test macOS |
Build failed |
a273aed
to
f7296ed
Compare
@swift-ci test |
Build failed |
@swift-ci test macOS |
Build failed |
@swift-ci smoke test macOS |
@swift-ci test macOS |
When a non-value instruction (e.g. a destroy_addr) was deleted, the corresponding cache entry in MemoryBehaviorCache was not invalidated.
If a new instruction was allocated at the same memory location, the old - and invalid - cache entry was re-used.
This bug triggered a SIL memory lifetime failure in TempRValueElimination.
https://bugs.swift.org/browse/SR-13985
rdar://problem/72614608
This change also fixes another problem (which I found by inspection): Individual result values of MultipleValueInstructions were not invalidated correctly.
Thanks to @compnerd for reducing the test case.