[libc-commits] [PATCH] D148717: [libc] Improve memcmp latency and codegen

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jun 28 07:49:29 PDT 2023


gchatelet marked 2 inline comments as done.
gchatelet added inline comments.


================
Comment at: libc/src/string/memory_utils/utils.h:194
+  // (e.g., int8_t ∈ [-128, 127]) returning 'INT_MIN' would break such code as
+  // `-INT_MIN` is not representable as an int32_t.
+
----------------
xbolva00 wrote:
> So they have UB in their codebases. They should really fix instead of workarounds like this one.
> So they have UB in their codebases. They should really fix instead of workarounds like this one.

Yeah I agree, I've been pushing for this but we have many instances of this bug (not only in `sqlite3.c`) and they're quite painful to chase down. They usually show up quite far away from the actual `memcmp` call. Fixing all of them will take time but we'll release the optimized version eventually /me hope.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148717



More information about the libc-commits mailing list