LoopVectorize: Fix accidentaly inverted condition.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 23 Dec 2012 13:21:41 +0000 (13:21 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 23 Dec 2012 13:21:41 +0000 (13:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171001 91177308-0d34-0410-b5e6-96231b3b80d8

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,