[InstCombine] Transform bcopy to memmove
authorDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 2 Oct 2019 22:49:20 +0000 (22:49 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 2 Oct 2019 22:49:20 +0000 (22:49 +0000)
commit6b45029676e5d0b5eb5baddab919c511881dd186
tree803683d1f0de3c345d26a5de37149fa069266c5e
parentf5bda7fe24edd21a7f3fc71129d1cca8fd277a1d
[InstCombine] Transform bcopy to memmove

bcopy is still widely used mainly for network apps. Sadly, LLVM has no optimizations for bcopy, but there are some for memmove.
Since bcopy == memmove, it is profitable to transform bcopy to memmove and use current optimizations for memmove for free here.

llvm-svn: 373537
llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/bcopy.ll [new file with mode: 0644]