[SLP]Fix comparator for cmp instruction vectorization.
authorAlexey Bataev <a.bataev@outlook.com>
Tue, 7 Dec 2021 18:16:14 +0000 (10:16 -0800)
committerAlexey Bataev <a.bataev@outlook.com>
Thu, 9 Dec 2021 18:57:57 +0000 (10:57 -0800)
commit19c5cf4167f645ac4f612a32abcc4d5a469cb214
tree659d107f6fd26e8518c7baa0a1849bb340edf285
parent0d13f94c1da994e5ad6cf18206d6ca2f6056ef02
[SLP]Fix comparator for cmp instruction vectorization.

The comparator for the sort functions should provide strict weak
ordering relation between parameters. Current solution causes compiler
crash with some standard c++ library implementations, because it does
not meet this criteria. Tried to fix it + it improves the iverall
vectorization result.

Differential Revision: https://reviews.llvm.org/D115268
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/used-reduced-op.ll
llvm/test/Transforms/SLPVectorizer/X86/vectorize-cmps.ll [new file with mode: 0644]