[PATCH] D78991: [TargetLibraryInfo] memcpy and memset have optimized codegen.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 03:43:33 PDT 2020


courbet created this revision.
Herald added a project: LLVM.

Add memcpy and memset to the list of function with optimized codegen.
hasOptimizedCodeGen() was returning false for them.
This was not an issue when working with c++ as clang typically emits an
intrinsic rather than a libfunc call, but when working with IR,
this would cause some issues with sanitizers which would not correctly
mark the function as nobuiltin in `maybeMarkSanitizerLibraryCallNoBuiltin()`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78991

Files:
  llvm/include/llvm/Analysis/TargetLibraryInfo.h


Index: llvm/include/llvm/Analysis/TargetLibraryInfo.h
===================================================================
--- llvm/include/llvm/Analysis/TargetLibraryInfo.h
+++ llvm/include/llvm/Analysis/TargetLibraryInfo.h
@@ -350,6 +350,7 @@
     case LibFunc_trunc:        case LibFunc_truncf:     case LibFunc_truncl:
     case LibFunc_log2:         case LibFunc_log2f:      case LibFunc_log2l:
     case LibFunc_exp2:         case LibFunc_exp2f:      case LibFunc_exp2l:
+    case LibFunc_memcpy:       case LibFunc_memset:
     case LibFunc_memcmp:       case LibFunc_bcmp:       case LibFunc_strcmp:
     case LibFunc_strcpy:       case LibFunc_stpcpy:     case LibFunc_strlen:
     case LibFunc_strnlen:      case LibFunc_memchr:     case LibFunc_mempcpy:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78991.260582.patch
Type: text/x-patch
Size: 764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200428/43425240/attachment.bin>


More information about the llvm-commits mailing list