mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
Use integer log for metric calculation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35834 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c415afc726
commit
54e2b142be
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user