Commit dd5991cc modified the aliasing checks here to allow transforming a memcpy where the source and destination point into the same object. However, the change accidentally made the code skip the alias check for other operations in the loop.
Instead of completely skipping the alias check, just skip the check for whether the memcpy aliases itself.