HomePhabricator

[SLC] Optimize mempcpy_chk to mempcpy

Authored by xbolva00 on Mon, Oct 5, 1:16 PM.

Description

[SLC] Optimize mempcpy_chk to mempcpy

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);.

Reviewed By: efriedma

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

Details