aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-04-09 21:57:03 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-04-09 21:57:03 +0000
commit54e2b142be6ac759e87dde8a643a7beaff0365df (patch)
tree6dc17d545b801f3ec74f0f6ebc7d6fdecd7446eb /lib/CodeGen
parentc415afc726fd106cdcc8b776ac2836612237e5d2 (diff)
downloadexternal_llvm-54e2b142be6ac759e87dde8a643a7beaff0365df.zip
external_llvm-54e2b142be6ac759e87dde8a643a7beaff0365df.tar.gz
external_llvm-54e2b142be6ac759e87dde8a643a7beaff0365df.tar.bz2
Use integer log for metric calculation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35834 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index cd61d111..e1a8c29 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1604,7 +1604,7 @@ bool SelectionDAGLowering::handleBTSplitSwitchCase(CaseRec& CR,
assert((RBegin-LEnd>=1) && "Invalid case distance");
double LDensity = (double)LSize / (double)((LEnd - First) + 1ULL);
double RDensity = (double)RSize / (double)((Last - RBegin) + 1ULL);
- double Metric = log(double(RBegin-LEnd))*(LDensity+RDensity);
+ double Metric = Log2_64(RBegin-LEnd)*(LDensity+RDensity);
// Should always split in some non-trivial place
DOUT <<"=>Step\n"
<< "LEnd: " << LEnd << ", RBegin: " << RBegin << "\n"
@@ -1620,7 +1620,7 @@ bool SelectionDAGLowering::handleBTSplitSwitchCase(CaseRec& CR,
RSize -= J->size();
}
// If our case is dense we *really* should handle it earlier!
- assert((FMetric != 0) && "Should handle dense range earlier!");
+ assert((FMetric > 0) && "Should handle dense range earlier!");
CaseRange LHSR(CR.Range.first, Pivot);
CaseRange RHSR(Pivot, CR.Range.second);