[SLPVectorizer] Pass the right type argument to getCmpSelInstrCost()
In getEntryCost(), make the scalar type for a compare instruction that of the operands, not i1. This is needed in order to call getCmpSelInstrCost() for a compare in a sensible way, the same way as the LoopVectorizer does. New test: test/Transforms/SLPVectorizer/SystemZ/SLP-cmp-cost-query.ll Review: Matthew Simpson https://reviews.llvm.org/D31601 llvm-svn: 300061
This commit is contained in:
@@ -1702,6 +1702,8 @@ int BoUpSLP::getEntryCost(TreeEntry *E) {
|
||||
Type *ScalarTy = VL[0]->getType();
|
||||
if (StoreInst *SI = dyn_cast<StoreInst>(VL[0]))
|
||||
ScalarTy = SI->getValueOperand()->getType();
|
||||
else if (CmpInst *CI = dyn_cast<CmpInst>(VL[0]))
|
||||
ScalarTy = CI->getOperand(0)->getType();
|
||||
VectorType *VecTy = VectorType::get(ScalarTy, VL.size());
|
||||
|
||||
// If we have computed a smaller type for the expression, update VecTy so
|
||||
|
||||
Reference in New Issue
Block a user