]> granicus.if.org Git - llvm/commit
[InstCombine] mempcpy(d,s,n) to memcpy(d,s,n) + n
authorDavid Bolvansky <david.bolvansky@gmail.com>
Sat, 31 Aug 2019 18:19:05 +0000 (18:19 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Sat, 31 Aug 2019 18:19:05 +0000 (18:19 +0000)
commit30f7e67339872426fb045ceb4579ca3aa6d80214
tree06488b23b6767c3ce912fce61920ae286c4cce36
parent565a281f1d682eb47944125054c1821b4844d931
[InstCombine] mempcpy(d,s,n) to memcpy(d,s,n) + n

Summary:
Back-end currently expands mempcpy, but middle-end should work with memcpy instead of mempcpy to enable more memcpy-optimization.

GCC backend emits mempcpy, so LLVM backend could form it too, if we know mempcpy libcall is better than memcpy + n.
https://godbolt.org/z/dOCG96

Reviewers: efriedma, spatel, craig.topper, RKSimon, jdoerfert

Reviewed By: efriedma

Subscribers: hjl.tools, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65737

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370593 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/SimplifyLibCalls.h
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/mempcpy.ll