[all-commits] [llvm/llvm-project] 3f1fd5: [SLC] Optimize mempcpy_chk to mempcpy

Dávid Bolvanský via All-commits all-commits at lists.llvm.org
Mon Oct 5 13:19:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f1fd59de3002e3d5a4eca98cd49c45755ab0110
      https://github.com/llvm/llvm-project/commit/3f1fd59de3002e3d5a4eca98cd49c45755ab0110
  Author: Dávid Bolvanský <david.bolvansky at gmail.com>
  Date:   2020-10-05 (Mon, 05 Oct 2020)

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

  Log Message:
  -----------
  [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




More information about the All-commits mailing list