[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:51:00 PDT 2022


goldstein.w.n added a comment.

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

> In D56593#3585621 <https://reviews.llvm.org/D56593#3585621>, @goldstein.w.n wrote:
>
>> 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.
>
> This is kinda sad, but OK.

Indeed. The original patch that kicked this off was just to optimize `bcmp` so the LLVM optimization
would be meaningful. Cest la vie.

>>> 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
>
> I personally don't have a strong opinion, but I know that during the initial RFC some people were against adding a backend flag for this (https://reviews.llvm.org/D56248): see the discussion here: https://lists.llvm.org/pipermail/llvm-dev/2019-January/128827.html.

I guess we can go with the flag being used by gcc: `-fextra-libc-function=__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