[PATCH] D127461: [SelectionDAG] Use __memcmpeq to replace bcmp and bool usage memcmp

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 13:30:47 PDT 2022


efriedma added a comment.

We already effectively have a platform version number on Mac/iOS/Android; adding a version number for another platform isn't a big deal.  (Yes, it doesn't really scale in the sense that every libc needs to have some entries in TargetLibraryInfo.cpp, but we basically end up doing that anyway, in practice.)

The tricky thing is that there isn't any easy way to tell the glibc version number.  The clang driver would have to dig through either system headers or the glibc library itself.

The alternative is that clang IR generation could check if __memcmpeq is declared somewhere in the file, and add some metadata to the module.  That's also sort of ugly, but maybe easier to implement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127461



More information about the llvm-commits mailing list