[LIR] Add support for creating memcpys from loops with a negative stride.
authorChad Rosier <mcrosier@codeaurora.org>
Fri, 13 Nov 2015 21:51:02 +0000 (21:51 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Fri, 13 Nov 2015 21:51:02 +0000 (21:51 +0000)
commit2588aa94253d33f1d90279e4ef492fc021aa39a6
tree58b65687d991260a92327708fbbd172c85e666d4
parent3b47b1f0e23c748ba37a7451724afec648542dfd
[LIR] Add support for creating memcpys from loops with a negative stride.

This allows us to transform the below loop into a memcpy.

void test(unsigned *__restrict__ a, unsigned *__restrict__ b) {
  for (int i = 2047; i >= 0; --i) {
    a[i] = b[i];
  }
}

This is the memcpy version of r251518, which added support for memset with
negative strided loops.

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