-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Don't pass dead values into proactively added phis in SILMem2Reg #36339
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 |
Build failed |
46ac85e
to
0075ef8
Compare
@swift-ci test |
Build failed |
0075ef8
to
a85a171
Compare
@swift-ci test |
c95fceb
to
fddba11
Compare
@swift-ci test |
Build failed |
5b40be7
to
d258c16
Compare
d258c16
to
40cdb81
Compare
@swift-ci test |
@swift-ci test source compatibility |
Build failed |
Build failed |
40cdb81
to
c6aaabe
Compare
@swift-ci test |
@swift-ci test source compatibility |
c6aaabe
to
37ebe16
Compare
37ebe16
to
b88e6b7
Compare
@swift-ci test |
Build failed |
@swift-ci test OSX platform |
@swift-ci test macOS platform |
b88e6b7
to
e9d1ca0
Compare
@swift-ci test |
Build failed |
…Mem2Reg Add utility to create end_lifetime at leaking blocks for an owned value
e9d1ca0
to
5ba12e1
Compare
Opened #38265 as an alternate PR. |
Mem2Reg proactively inserts phis. Some of the phis maybe operands to other phis but are not stored in any specific order in
PhiBlocks
structure. Instead of erasing phi's that are unnecessary, and walking up the phi operand chain to check if more phis need erasing, insert aend_lifetime
at leaking blocks. Such phis will be cleaned up later by DCE.Also until now, dead values (over consumed) maybe passed to such phis. This wasn't an issue in non-OSSA because there is no verification. In OSSA, this triggers a verifier assert. This PR fixes the OSSA SIL such that no over-consumed values are generated by Mem2Reg in such cases. It does this by identifying
load [take]
anddestroy_addr
to thealloc_stack
within a block not followed by any store. Such blocks are marked in thedeadValueBlock
map which will be used while querying the live-out value to returnundef
.Note this does not translate to a real bug.
Fixes rdar://79349413