[PATCH] D105440: [RFC] Implement support for __builtin_memcmp_inline

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 6 10:12:20 PDT 2021


efriedma added a comment.

In D105440#2859993 <https://reviews.llvm.org/D105440#2859993>, @gchatelet wrote:

> In D105440#2858438 <https://reviews.llvm.org/D105440#2858438>, @efriedma wrote:
>
>> The motivation here seems weaker than it was for memcpy.  memcmp is much less fundamental to LLVM optimizations.  It looks like the primary motivation here is to avoid duplicating the logic in llvm/lib/CodeGen/ExpandMemCmp.cpp ?  But really, it isn't very much target-independent logic, and the only target-specific bit is the heuristic for load widths.
>
> I'd rather not duplicate logic in `llvm/lib/CodeGen/ExpandMemCmp.cpp` they may get out of sync.

The problem, from my perspective, is that you'll have to duplicate the logic to some extent anyway.  Even if __builtin_memcmp_inline is technically available, that doesn't let you access the underlying heuristics, so you'll need special-case logic for every target anyway.


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

https://reviews.llvm.org/D105440



More information about the llvm-commits mailing list