Lines Matching refs:Cache

776 static void AssertSorted(MemoryDependenceResults::NonLocalDepInfo &Cache,
779 Count = Cache.size();
780 assert(std::is_sorted(Cache.begin(), Cache.begin() + Count) &&
781 "Cache isn't sorted!");
791 NonLocalDepInfo &Cache = CacheP.first;
798 if (!Cache.empty()) {
803 return Cache;
808 for (auto &Entry : Cache)
813 llvm::sort(Cache);
817 // << Cache.size() << " cached: " << *QueryInst;
831 unsigned NumSortedEntries = Cache.size();
832 LLVM_DEBUG(AssertSorted(Cache));
845 LLVM_DEBUG(AssertSorted(Cache, NumSortedEntries));
847 std::upper_bound(Cache.begin(), Cache.begin() + NumSortedEntries,
849 if (Entry != Cache.begin() && std::prev(Entry)->getBB() == DirtyBB)
853 if (Entry != Cache.begin() + NumSortedEntries &&
894 Cache.push_back(NonLocalDepEntry(DirtyBB, Dep));
912 return Cache;
974 /// cached information in Cache or by doing a lookup (which may use dirty cache
980 BasicBlock *BB, NonLocalDepInfo *Cache, unsigned NumSortedEntries) {
985 Cache->begin(), Cache->begin() + NumSortedEntries, NonLocalDepEntry(BB));
986 if (Entry != Cache->begin() && (Entry - 1)->getBB() == BB)
990 if (Entry != Cache->begin() + NumSortedEntries && Entry->getBB() == BB)
1010 // Eliminating the dirty entry from 'Cache', so update the reverse info.
1026 Cache->push_back(NonLocalDepEntry(BB, Dep));
1030 // to Cache!
1048 SortNonLocalDepInfoCache(MemoryDependenceResults::NonLocalDepInfo &Cache,
1050 switch (Cache.size() - NumSortedEntries) {
1056 NonLocalDepEntry Val = Cache.back();
1057 Cache.pop_back();
1059 std::upper_bound(Cache.begin(), Cache.end() - 1, Val);
1060 Cache.insert(Entry, Val);
1065 if (Cache.size() != 1) {
1066 NonLocalDepEntry Val = Cache.back();
1067 Cache.pop_back();
1069 std::upper_bound(Cache.begin(), Cache.end(), Val);
1070 Cache.insert(Entry, Val);
1075 llvm::sort(Cache);
1169 NonLocalDepInfo *Cache = &CacheInfo->NonLocalDeps;
1180 for (auto &Entry : *Cache) {
1194 for (auto &Entry : *Cache) {
1213 if (Cache->empty())
1229 unsigned NumSortedEntries = Cache->size();
1232 LLVM_DEBUG(AssertSorted(*Cache));
1244 if (Cache && NumSortedEntries != Cache->size()) {
1245 SortNonLocalDepInfoCache(*Cache, NumSortedEntries);
1247 // Since we bail out, the "Cache" set won't contain all of the
1263 LLVM_DEBUG(AssertSorted(*Cache, NumSortedEntries));
1265 Cache, NumSortedEntries);
1327 if (Cache && NumSortedEntries != Cache->size()) {
1328 SortNonLocalDepInfoCache(*Cache, NumSortedEntries);
1329 NumSortedEntries = Cache->size();
1331 Cache = nullptr;
1418 // Refresh the CacheInfo/Cache pointer so that it isn't invalidated.
1420 Cache = &CacheInfo->NonLocalDeps;
1421 NumSortedEntries = Cache->size();
1423 // Since we did phi translation, the "Cache" set won't contain all of the
1436 if (!Cache) {
1437 // Refresh the CacheInfo/Cache pointer if it got invalidated.
1439 Cache = &CacheInfo->NonLocalDeps;
1440 NumSortedEntries = Cache->size();
1443 // Since we failed phi translation, the "Cache" set won't contain all of the
1458 for (NonLocalDepEntry &I : llvm::reverse(*Cache)) {
1476 SortNonLocalDepInfoCache(*Cache, NumSortedEntries);
1477 LLVM_DEBUG(AssertSorted(*Cache));
1518 // Eliminating the dirty entry from 'Cache', so update the reverse info.