Skip to content
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

Fix MemorySSA preservation in julia-licm #50315

Merged
merged 3 commits into from
Jun 28, 2023
Merged

Conversation

pchintalapudi
Copy link
Member

The MemorySSA verification failures were caused by an unfortunate case where we sunk one gc_preserve_end to an exit block, then sunk another one to the same exit block after the first gc_preserve_end. However, we were inserting the MemorySSA use as if we had sunk the second gc_preserve_end to be before the first gc_preserve_end. This fixes the bug by updating the exit point of the loop each time we sink an instruction, so that subsequent sinks do insert at the beginning of the basic block.

There's also a separate bug where the memset for hoisted allocations was marked as a MemoryDef with a LiveOnEntry parent, when it should have been the allocation's MemoryDef. That has also been fixed here.

Tests have been added for both of these cases. Fixes #50305 , and probably addresses the MemorySSA assertion in #50170

@pchintalapudi pchintalapudi added the compiler:llvm For issues that relate to LLVM label Jun 27, 2023
@pchintalapudi pchintalapudi added this to the 1.10 milestone Jun 27, 2023
@vchuravy
Copy link
Member

Thanks Prem!

@vchuravy vchuravy merged commit 1177b54 into master Jun 28, 2023
@vchuravy vchuravy deleted the pc/fix-mssa-preserve branch June 28, 2023 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:llvm For issues that relate to LLVM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Master with debug + assertions triggers an assertion
2 participants