This is an archive of the discontinued LLVM Phabricator instance.

AssumptionCache: remove old affected values after RAUW
ClosedPublic

Authored by t.p.northover on Aug 7 2019, 1:48 AM.

Details

Reviewers
hfinkel
Summary

If they're left in the cache then they can't be removed efficiently when the cache is notified to unlink a @llvm.assume call, and that can lead to values from different functions entirely remaining there. ValueTracking.cpp does not like this.

There aren't that many users of the assumption cache so we could modify them to cope with this situation, but I decided the cache was still messed up and most RAUW calls are fairly swiftly followed by removing the original so not much is lost by transferring any assumptions.

Unfortunately I couldn't write a test for this, the example I had was huge (from Clang's ExprConstant) and didn't reproduce under opt even with the whole file.

Diff Detail

Event Timeline

t.p.northover created this revision.Aug 7 2019, 1:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2019, 1:48 AM
hfinkel accepted this revision.Aug 9 2019, 2:58 AM
hfinkel added a subscriber: hfinkel.

LGTM

This revision is now accepted and ready to land.Aug 9 2019, 2:58 AM
t.p.northover closed this revision.Aug 16 2019, 2:34 AM

Thanks Hal. Committed as r369091.