When a SCEVUnknown gets RAUWd, we currently drop it from the folding set, but don't forget memoized values. I believe we should be treating RAUW the same way as deletion here and invalidate all caches and dependent expressions.
I don't have any specific cases where this causes issues right now. This patch is inspired by the FIXME in https://reviews.llvm.org/D119488.