[BUG] Fix -Wunused-variable warning in Release mode. Thnx to Kostya Serebryany for pointing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207516 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zinovy Nis 2014-04-29 09:45:08 +00:00
parent 43705683fd
commit 0f79399dee

View File

@ -5096,9 +5096,11 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize,
}
float Cost = expectedCost(1);
#ifndef NDEBUG
const float ScalarCost = Cost;
#endif /* NDEBUG */
unsigned Width = 1;
DEBUG(dbgs() << "LV: Scalar loop costs: " << (int)Cost << ".\n");
DEBUG(dbgs() << "LV: Scalar loop costs: " << (int)ScalarCost << ".\n");
// Ignore scalar width, because the user explicitly wants vectorization.
if (ForceVectorization && VF > 1) {
@ -5122,7 +5124,6 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize,
DEBUG(if (ForceVectorization && Width > 1 && Cost >= ScalarCost) dbgs()
<< "LV: Vectorization seems to be not beneficial, "
<< "but was forced by a user.\n");
(void)ScalarCost;
DEBUG(dbgs() << "LV: Selecting VF: "<< Width << ".\n");
Factor.Width = Width;
Factor.Cost = Width * Cost;