[libc-commits] [PATCH] D82134: Add strcmp.

Paula Toth via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jun 18 18:35:56 PDT 2020


PaulkaToast added inline comments.


================
Comment at: libc/src/string/strcmp.cpp:15
+
+int LLVM_LIBC_ENTRYPOINT(strcmp)(const char *l, const char *r) {
+  while (*l) {
----------------
sivachandra wrote:
> Is there benefit in comparing words at a time? I know that it leads to potential OOB reads, so we can handle it separately. But if it can lead to speed up, just a leave a TODO about it and we will get to it in a later round.
I would suggest to opt for more descriptive variable names over single letter one. i.e ("left" instead of "l").


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82134





More information about the libc-commits mailing list