File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 5151#include < cassert>
5252#include < iterator>
5353#include < utility>
54- #include < cmath>
5554
5655using namespace llvm ;
5756
@@ -84,9 +83,6 @@ static cl::opt<unsigned>
8483// Limit on the number of memdep results to process.
8584static const unsigned int NumResultsLimit = 100 ;
8685
87- // for quickly calculating log
88- const float ln2 = 0 .69314718f ;
89-
9086// / This is a helper function that removes Val from 'Inst's set in ReverseMap.
9187// /
9288// / If the set becomes empty, remove Inst's entry.
@@ -995,19 +991,19 @@ MemDepResult MemoryDependenceResults::getNonLocalInfoForBlock(
995991static void
996992SortNonLocalDepInfoCache (MemoryDependenceResults::NonLocalDepInfo &Cache,
997993 unsigned NumSortedEntries) {
998-
994+ if (Cache.size () == 1 )
995+ return ;
999996 auto s = Cache.size () - NumSortedEntries;
1000- if (s < log2 (Cache.size ()) * ln2) {
1001- while (s> 0 ) {
997+ if (s < Log2_32 (Cache.size ()) * llvm::numbers:: ln2) {
998+ while (s > 0 ) {
1002999 NonLocalDepEntry Val = Cache.back ();
10031000 Cache.pop_back ();
10041001 MemoryDependenceResults::NonLocalDepInfo::iterator Entry =
1005- std ::upper_bound (Cache. begin (), Cache. end () - 1 , Val);
1002+ llvm ::upper_bound (Cache, Val);
10061003 Cache.insert (Entry, Val);
10071004 s--;
10081005 }
1009- }
1010- else {
1006+ } else {
10111007 llvm::sort (Cache);
10121008 }
10131009}
You can’t perform that action at this time.
0 commit comments