[PATCH] D56593: [SelectionDAG][RFC] Allow the user to specify a memeq function (v5).

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 08:20:45 PDT 2022


goldstein.w.n added a comment.

In D56593#3584237 <https://reviews.llvm.org/D56593#3584237>, @courbet wrote:

> In D56593#3582442 <https://reviews.llvm.org/D56593#3582442>, @xbolva00 wrote:
>
>> @courbet Any followup as we have got "'__memcmpeq" ?
>
> I was under the impression that `bcmp` was redirecting to `__memcmpeq` when the latter was available. Isn't that sufficient ?

It is not.

This was rejected for the same reasons the `bcmp` optimizations where rejected. `bcmp` is not standardized and since
glibc has been maintaining it as a true `memcmp` (that can be used for sort), there is not reason for users to not have
begun to rely on that behavior.

> I don't think we can call `__memcmpeq` directly because this will not work on older versions of the glibc (as discussed above).

I have a patch here: https://reviews.llvm.org/D127461

The way I set it up its guarded behind a CLI option. I think the direction GCC plans to head
is to enable the optimization if there is a declaration of "__memcmpeq".


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56593



More information about the llvm-commits mailing list