LoopVectorize: Fix accidentaly inverted condition.
[oota-llvm.git] / lib / Transforms / Vectorize / LoopVectorize.cpp
index ddb7f2607e57168c4ef6af21aa6e3456844a0a8b..1d78fac500daa20c517b9e3237619ed74f782b1f 100644 (file)
@@ -2181,7 +2181,7 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I, unsigned VF) {
     // elements, times the vector width.
     unsigned Cost = 0;
 
-    if (RetTy->isVoidTy() || VF != 1) {
+    if (!RetTy->isVoidTy() && VF != 1) {
       unsigned InsCost = VTTI->getVectorInstrCost(Instruction::InsertElement,
                                                   VectorTy);
       unsigned ExtCost = VTTI->getVectorInstrCost(Instruction::ExtractElement,