[llvm] r207516 - [BUG] Fix -Wunused-variable warning in Release mode. Thnx to Kostya Serebryany for pointing.
Zinovy Nis
zinovy.nis at gmail.com
Tue Apr 29 02:45:09 PDT 2014
Author: zinovy.nis
Date: Tue Apr 29 04:45:08 2014
New Revision: 207516
URL: http://llvm.org/viewvc/llvm-project?rev=207516&view=rev
Log:
[BUG] Fix -Wunused-variable warning in Release mode. Thnx to Kostya Serebryany for pointing.
Modified:
llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=207516&r1=207515&r2=207516&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Tue Apr 29 04:45:08 2014
@@ -5096,9 +5096,11 @@ LoopVectorizationCostModel::selectVector
}
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::selectVector
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;
More information about the llvm-commits
mailing list