This is an archive of the discontinued LLVM Phabricator instance.

[LegacyPassManager] Remove analysis P from AnUsageMap before deleting it in schedulePass.
ClosedPublic

Authored by craig.topper on Aug 10 2018, 10:52 AM.

Details

Summary

If we deem the analysis pass useless and delete it, we need to make sure we remove it from AnUsageMap. Otherwise we might allocate another pass in the freed memory. This will cause us to reuse the AnalysisUsage from the original pass instead of the new one.

Fixes PR38511

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Aug 10 2018, 10:52 AM
chandlerc accepted this revision.Aug 20 2018, 1:37 PM

This seems like a fine patch... But can we add a test that hits this? Feel free to submit w/ test case though, the code here seems trivial.

This revision is now accepted and ready to land.Aug 20 2018, 1:37 PM
This revision was automatically updated to reflect the committed changes.