LoopIdiom: Recognize memmove loops.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 27 Oct 2012 14:25:51 +0000 (14:25 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 27 Oct 2012 14:25:51 +0000 (14:25 +0000)
commitd11c5d08a5f4f030d6e357378d0d46d93efd9a59
tree95e77226ccabfa2fd6c5b171c64f038ccdef512d
parent96c8735e28f2f89be37cdd907f680c6c1bf16052
LoopIdiom: Recognize memmove loops.

This turns loops like
  for (unsigned i = 0; i != n; ++i)
    p[i] = p[i+1];
into memmove, which has a highly optimized implementation in most libcs.

This was really easy with the new DependenceAnalysis :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166875 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
test/Transforms/LoopIdiom/basic.ll