This is an archive of the discontinued LLVM Phabricator instance.

[LoopPassManager] Assert that MemorySSA is preserved if used
ClosedPublic

Authored by nikic on Aug 19 2021, 12:01 PM.

Details

Summary

Currently it's possible to silently use a loop pass that does not preserve MemorySSA in a loop-mssa pass manager, as we don't statically know which loop passes preserve MemorySSA (as was the case with the legacy pass manager).

However, we can at least add a check after the fact that if MemorySSA is used, then it should also have been preserved. Hopefully this will reduce confusion as seen in https://bugs.llvm.org/show_bug.cgi?id=51020.

Diff Detail

Event Timeline

nikic created this revision.Aug 19 2021, 12:01 PM
nikic requested review of this revision.Aug 19 2021, 12:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2021, 12:01 PM
asbirlea accepted this revision.Aug 19 2021, 12:05 PM

Thank you!

This revision is now accepted and ready to land.Aug 19 2021, 12:05 PM

could you add a test?

nikic updated this revision to Diff 367602.Aug 19 2021, 1:27 PM

Add test

aeubanks accepted this revision.Aug 19 2021, 1:30 PM

perhaps this could go under NDEBUG? since that's when we're going to see issues anyway. but looks good as is

nikic added a comment.Aug 19 2021, 2:03 PM

perhaps this could go under NDEBUG? since that's when we're going to see issues anyway. but looks good as is

I think it makes sense to have this for non-assertion builds as well, as it can be triggered by user error.