Sorry for the delay. I've been occupied with other projects.
Not sure I fully understand the FIXME. Why not drop the equals case?
Nit: please fix lint.
I feel the logic here is a bit hard to read. Whether it's memcpy or not, it both requires IsSameObject to be true. Maybe change this to
bool UseMemMove = IsMemCpy || LoopAccessStore;
And then move the IsSameObject check into MemmoveVerifier?
Rebased and addressed comments.
Right, apparently I didn't think enough about that case so left fixme without good reason.
I agree logic is not very straightforward here. Your idea would work except isMemcpy and !IsSameObject case (like in memcpy-intrinsic.ll).