There are a number of causes here:
- Same as pr36063, change in dependence type from local to nonlocal,
or vice versa, can't be invalidated in the cache.
- MemDep does not do transitive cache invalidation, so
loads that would now point to a store/memcpy/etc that it has inserted,
will still point to the wrong place.
- An unknown cause i'm still tracking down that is causing preservation failure
even when memcpyopt does nothing!
The TL;DR is that anything that moves stores across blocks probably should not be preserving memdep
(or is most likely broken right now), a least until it can be fixed.