Fix a typo in the code that collected the costs recursively.
authorNadav Rotem <nrotem@apple.com>
Tue, 25 Jun 2013 05:30:56 +0000 (05:30 +0000)
committerNadav Rotem <nrotem@apple.com>
Tue, 25 Jun 2013 05:30:56 +0000 (05:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184827 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/SLPVectorizer.cpp

index 6837e51c9a672b6a68e2a175582d9ad990ece9c3..88bcd90839eb45514185f4bf3fe94eb4b6af329e 100644 (file)
@@ -727,7 +727,7 @@ int FuncSLP::getTreeCost_rec(ArrayRef<Value *> VL, unsigned Depth) {
       int Cost = getTreeCost_rec(Operands, Depth + 1);
       if (Cost == MAX_COST)
         return MAX_COST;
-      TotalCost += TotalCost;
+      TotalCost += Cost;
     }
 
     // Calculate the cost of this instruction.