Skip to content

Commit 521b216

Browse files
committed
[TargetLibraryInfo] memcpy and memset have optimized codegen.
Summary: 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()`. Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78991
1 parent 7ee479a commit 521b216

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/include/llvm/Analysis/TargetLibraryInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ class TargetLibraryInfo {
350350
case LibFunc_trunc: case LibFunc_truncf: case LibFunc_truncl:
351351
case LibFunc_log2: case LibFunc_log2f: case LibFunc_log2l:
352352
case LibFunc_exp2: case LibFunc_exp2f: case LibFunc_exp2l:
353+
case LibFunc_memcpy: case LibFunc_memset: case LibFunc_memmove:
353354
case LibFunc_memcmp: case LibFunc_bcmp: case LibFunc_strcmp:
354355
case LibFunc_strcpy: case LibFunc_stpcpy: case LibFunc_strlen:
355356
case LibFunc_strnlen: case LibFunc_memchr: case LibFunc_mempcpy:

0 commit comments

Comments
 (0)