Currently, MemCpyOpt::processStore will convert this
val = load A store _, B ; may-alias A store _, C ; may-alias A + D store val, D
into
store _, C ; may-alias A + D val = load A store val, D store _, B ; may-alias A
and then into
store _, C ; may-alias A + D memcpy(D, A) store _, B ; may-alias A
This is incorrect, since C and A may alias and therefore cannot be re-ordered.
Adding Amaury since this was introduced in http://reviews.llvm.org/D16523 .