[SLP]Fix a bug in min/max reduction, number of condition uses.
authorAlexey Bataev <a.bataev@outlook.com>
Thu, 1 Apr 2021 18:02:34 +0000 (11:02 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Fri, 2 Apr 2021 14:09:44 +0000 (07:09 -0700)
commit5fcb07a07020f6011128f9fe384fdef65cbcc7b7
treeb344ddee344f0be83fcd707c454721e677450d16
parentfa0aff6d6960e3ca4640b0a64b675a768ab99bf0
[SLP]Fix a bug in min/max reduction, number of condition uses.

The ultimate reduction node may have multiple uses, but if the ultimate
reduction is min/max reduction and based on SelectInstruction, the
condition of this select instruction must have only single use.

Differential Revision: https://reviews.llvm.org/D99753
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/horizontal-minmax.ll
llvm/test/Transforms/SLPVectorizer/X86/used-reduced-op.ll