[ExpandMemCmp] Properly constant-fold all compares.
authorClement Courbet <courbet@google.com>
Tue, 3 Mar 2020 12:17:21 +0000 (13:17 +0100)
committerClement Courbet <courbet@google.com>
Mon, 9 Mar 2020 08:10:34 +0000 (09:10 +0100)
commitf7e6f5f8e3046fd9a4528d77df3dfd458a9f437f
tree86c67ba78c9a1aaf0edc10cadb8e592f81597a95
parentee4dc980c031d00ba729dfd731808b214e01ee58
[ExpandMemCmp] Properly constant-fold all compares.

Summary:
This gets rid of duplicated code and diverging behaviour w.r.t.
constants.
Fixes PR45086.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75519
llvm/lib/CodeGen/ExpandMemCmp.cpp
llvm/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll
llvm/test/CodeGen/PowerPC/memcmpIR.ll
llvm/test/CodeGen/X86/memcmp.ll
llvm/test/Transforms/ExpandMemCmp/X86/memcmp.ll