[SCEV] Track and invalidate ValuesAtScopes users
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 30 Nov 2021 11:02:23 +0000 (12:02 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 30 Nov 2021 17:21:14 +0000 (18:21 +0100)
commit37d72991c136244fe53be02f5af0ad643247a1e6
tree88e806f85c3b17a983b04e6da2ecc2079b7d67db
parentc737d4d203210f96919f4406e5b815b0946535ab
[SCEV] Track and invalidate ValuesAtScopes users

ValuesAtScopes maps a SCEV and a Loop to another SCEV. While we
invalidate entries if the left-hand SCEV is invalidated, we
currently don't do this for the right-hand SCEV. Fix this by
tracking users in a reverse map and using it for invalidation.

This is conceptually the same change as D114738, but using the
reverse map to avoid performance issues.

Differential Revision: https://reviews.llvm.org/D114788
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Transforms/IndVarSimplify/bbi-63564.ll [new file with mode: 0644]