[ExpandMemCmp] Properly expand `bcmp` to an equality pattern.
authorClement Courbet <courbet@google.com>
Fri, 15 Apr 2022 09:11:26 +0000 (11:11 +0200)
committerClement Courbet <courbet@google.com>
Fri, 15 Apr 2022 09:26:24 +0000 (11:26 +0200)
commit46a13a0ef847dbe3226f4b3d8726ef25c8909293
treea2c0a2d639e33420d0b44b754945b841ce231210
parent866bd4df477706c6ad1e5d6d2876d7a6eed4def8
[ExpandMemCmp] Properly expand `bcmp` to an equality pattern.

Before that change, constant-size `bcmp` would miss an opportunity to generate
a more efficient equality pattern and would generate a -1/0-1 pattern
instead.

Differential Revision: https://reviews.llvm.org/D123849
llvm/lib/CodeGen/ExpandMemCmp.cpp
llvm/test/CodeGen/X86/memcmp-optsize-x32.ll
llvm/test/CodeGen/X86/memcmp-optsize.ll
llvm/test/CodeGen/X86/memcmp-pgso-x32.ll
llvm/test/CodeGen/X86/memcmp-pgso.ll
llvm/test/Transforms/ExpandMemCmp/X86/bcmp.ll