[libc-commits] [PATCH] D142696: [libc] Check pointer equality in strcmp, strncmp, and memcmp

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Jan 30 05:07:51 PST 2023


gchatelet added a comment.

I suspect it is almost **never** the case that we call these functions with the same pointer on both sides.
In my opinion, this optimization is best done at the call site when the user suspects that it can actually happen.

For memfunction, we want to reduce the function's latency to a minimum so the check being in the hot path actually hinders performance.

So, codewise this patch is fine but I don't think we should submit it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142696



More information about the libc-commits mailing list