[PATCH] D86019: [SLC] Optimize _mempcpy_chk to direct call to mempcpy

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 15 09:04:29 PDT 2020


xbolva00 created this revision.
xbolva00 added a reviewer: efriedma.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
xbolva00 requested review of this revision.

As reported in PR46735:

void* f(void *d, const void *s, size_t l)
{

  return __builtin___mempcpy_chk(d, s, l, __builtin_object_size(d, 0));

}

This can be optimized to `return mempcpy(d, s, l);`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86019

Files:
  llvm/include/llvm/Analysis/TargetLibraryInfo.def
  llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
  llvm/lib/Analysis/TargetLibraryInfo.cpp
  llvm/lib/Transforms/Utils/BuildLibCalls.cpp
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
  llvm/test/Transforms/InstCombine/fortify-folding.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86019.285846.patch
Type: text/x-patch
Size: 6085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200815/a4012528/attachment.bin>


More information about the llvm-commits mailing list