[MergeICmps] Adapt to non-eq comparisons, fix bug for cases need be spilted
authorzhongyunde <zhongyunde@huawei.com>
Thu, 9 Mar 2023 15:48:51 +0000 (23:48 +0800)
committerzhongyunde <zhongyunde@huawei.com>
Thu, 9 Mar 2023 15:49:09 +0000 (23:49 +0800)
commit818e554e251c1e07f133aeed9fe0473502ebfdae
treec0a2060672859d4cdac940e3aee12200240c37bf
parent0041f081962c60a96d45d9a3a964c2d00216c16d
[MergeICmps] Adapt to non-eq comparisons, fix bug for cases need be spilted

Fix the last runtime issue as some sequent comparisons need be spilted.
For the origin equal comparisons chain, the new spilted Icmp chain will
still be end with equal, while for the new not-equal comparisons chain,
the new spilted Icmp chain will still be end with equal, so should address
this carefully, see detail wih case partial_sequent_ne.

Thanks for @glandium and @ayzhao report the runtime issue and carefully
examine.
Fix https://github.com/llvm/llvm-project/issues/59740.

Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D141188
llvm/lib/Transforms/Scalar/MergeICmps.cpp
llvm/test/Transforms/MergeICmps/X86/pr59740.ll [new file with mode: 0644]