[LoopIdiom] Fix bailout for aliasing in memcpy transform.
commitabdf0da8009f272f6c3d6398cf63f9f0a8257637
authorEli Friedman <efriedma@quicinc.com>
Tue, 31 May 2022 23:51:03 +0000 (31 16:51 -0700)
committerEli Friedman <efriedma@quicinc.com>
Wed, 1 Jun 2022 00:24:23 +0000 (31 17:24 -0700)
tree10b6b74463689bc044d8fc197b3fc3b69da27b3b
parentd92f7f790c8e74bf796a0313cb296d726628142e
[LoopIdiom] Fix bailout for aliasing in memcpy transform.

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.

Differential Revision: https://reviews.llvm.org/D126486
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
llvm/test/Transforms/LoopIdiom/basic.ll