[IRGen] Deadends don't need dealloc_pack_metadata. #73191
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is a debug-build-only verification that is done for alloc_pack_metadata instructions that checks that there exist paired dealloc_pack_metadata instructions which will be keyed off of to clean up the on-stack variadic metadata packs corresponding to (the instruction after) the alloc_pack_metadata.
StackNesting omits the deallocation instruction (as does PackMetadataMarkerInserter) if it would be created in a dead end block. If all blocks in the dominance frontier of the alloc_pack_metadata instruction are dead-end blocks, then the verification will incorrectly fail. It should not fail because it is not necessary to clean up the on-stack pack metadata (or any other stack allocations) in such a case.
If all such blocks are dead-end blocks, however, the alloc_pack_metadata's block itself is a dead-end block as well. So during the verification, check whether the alloc_pack_metadata occurs in a dead-end block and do not fail verification if it does.
rdar://125265980