[AArch64] Optimize more memcmp when the result is tested for [in]equality with 0
authorzhongyunde <zhongyunde@huawei.com>
Sun, 13 Nov 2022 03:01:45 +0000 (11:01 +0800)
committerzhongyunde <zhongyunde@huawei.com>
Sun, 13 Nov 2022 03:02:34 +0000 (11:02 +0800)
commit894f9e54f59522f57b7a106b0c2f031260964ce8
tree881376c6d16c38d2e5d53c3db4591ec4f0888217
parenta4ef4445a065da10f8255e4bae6d2a04a6515863
[AArch64] Optimize more memcmp when the result is tested for [in]equality with 0

We already surpport the or (xor a, b), (xor c, d) with D136244, while it should
capture more cases than just bcmp according the comment on
https://reviews.llvm.org/D136672, so this patch try to fold continuous
comparison series.

Also add a new callsite in LowerSETCC to address some cases folded And in the
stage of `Optimized type-legalized selection`.
Depends on D136244

Reviewed By: dmgreen, bcl5980
Differential Revision: https://reviews.llvm.org/D137721
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/bcmp-inline-small.ll
llvm/test/CodeGen/AArch64/bcmp.ll