This is an archive of the discontinued LLVM Phabricator instance.

Only passes that preserve MemorySSA must mark it as preserved.
ClosedPublic

Authored by asbirlea on May 28 2019, 11:01 AM.

Details

Summary

The method getLoopPassPreservedAnalyses should not mark MemorySSA as
preserved, because it's being called in a lot of passes that do not
preserve MemorySSA.
Instead, mark the MemorySSA analysis as preserved by each pass that does
preserve it.
These changes only affect the new pass mananger.

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea created this revision.May 28 2019, 11:01 AM
chandlerc accepted this revision.Jun 8 2019, 1:49 AM

LGTM

Any chance you can add a test that shows one of the problems where verifying MemorySSA fails because we get a "preserved" copy after a loop pass that doesn't actually preserve it?

Fine to submit the patch whenever, and just try ta add a test case when its convenient.

This revision is now accepted and ready to land.Jun 8 2019, 1:49 AM
This revision was automatically updated to reflect the committed changes.

I wasn't yet able to reproduce this with opt -aa-pipeline=default -passes="default<O3>", only with clang -cc1 -O3 -fexperimental-new-pass-manager.
I'll keep working on getting a test, but I checked this in for now, since it's necessary to fix crashes for the combination of MemorySSA + NewPassManager.