[libc-commits] [PATCH] D129808: [libc] add unsafe mode to strlen

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Nov 30 16:44:04 PST 2022


michaelrj added inline comments.


================
Comment at: libc/cmake/modules/LLVMLibCCommonTuners.cmake:7
+
+option(LIBC_STRING_WIDE_READ "Read strings for strlen and memchr as int sized blocks instead of bytes. This relies on undefined behavior and may fail on some systems, but improves performance on long strings." OFF)
+if(LIBC_STRING_WIDE_READ)
----------------
sivachandra wrote:
> The earlier name of `LIBC_UNSAFE_WORD_READ` was more suggestive than this name. Also, I think the description should be more generic instead of referring to strlen and memchr.
I compromised on `LIBC_STRING_UNSAFE_WIDE_READ` which I think has all the relevant information.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129808/new/

https://reviews.llvm.org/D129808



More information about the libc-commits mailing list