This is an archive of the discontinued LLVM Phabricator instance.

Fully delete stale SCEVs from ValuesAtScope map
AbandonedPublic

Authored by reames on Nov 29 2021, 1:48 PM.

Details

Summary

This fixes the regression reported against D111533. I don't actually believe this is a regression, but trying to message things enough to trigger without that change doesn't seem particular worthwhile either.

Diff Detail

Event Timeline

reames created this revision.Nov 29 2021, 1:48 PM
reames requested review of this revision.Nov 29 2021, 1:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2021, 1:48 PM
nikic added a comment.Nov 30 2021, 2:31 AM

The idea here is right, but I'm concerned that this will have pathological cases, because we need to scan the whole ValuesAtScopes map any time we forget something. This map can be large. The proper way to handle this would be to add a reverse map for invalidation purposes (similar to D114784, but for ValuesAtScope).

llvm/lib/Analysis/ScalarEvolution.cpp
12897

Should be easy to do with llvm::remove_if().

reames abandoned this revision.Nov 30 2021, 8:35 AM

Abandon in favor of @nikic's alternate patch.

@nikic patch indeed solved the problem.
Thanks!