(This was also on llvm-commits last week without test case: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170327/442107.html)
I found that the SLP vectorizer does not call getCmpSelInstrCost() for a
compare with the proper type. It currently passes i1 or a vector of i1s,
instead of the type of the compare operand, like LoopVectorizer does.
My patch fixes this by getting the right scalar type for compares. No
regressions after applying this patch.
The test case is for SystemZ, and depends on https://reviews.llvm.org/D29631#09b6b393.
Why not use an "else if" here?