Home | History | Annotate | Download | only in Analysis

Lines Matching refs:Cache

444   // Create a numbered basic block to lazily compute and cache instruction
735 /// This method is used when -debug is specified to verify that cache arrays
737 static void AssertSorted(MemoryDependenceResults::NonLocalDepInfo &Cache,
740 Count = Cache.size();
741 assert(std::is_sorted(Cache.begin(), Cache.begin() + Count) &&
742 "Cache isn't sorted!");
752 NonLocalDepInfo &Cache = CacheP.first;
759 if (!Cache.empty()) {
760 // Okay, we have a cache entry. If we know it is not dirty, just return it
764 return Cache;
769 for (auto &Entry : Cache)
773 // Sort the cache so that we can do fast binary search lookups below.
774 std::sort(Cache.begin(), Cache.end());
778 // << Cache.size() << " cached: " << *QueryInst;
792 unsigned NumSortedEntries = Cache.size();
793 DEBUG(AssertSorted(Cache));
805 // the cache set. If so, find it.
806 DEBUG(AssertSorted(Cache, NumSortedEntries));
808 std::upper_bound(Cache.begin(), Cache.begin() + NumSortedEntries,
810 if (Entry != Cache.begin() && std::prev(Entry)->getBB() == DirtyBB)
814 if (Entry != Cache.begin() + NumSortedEntries &&
856 Cache.push_back(NonLocalDepEntry(DirtyBB, Dep));
874 return Cache;
926 /// cached information in Cache or by doing a lookup (which may use dirty cache
929 /// If we do a lookup, add the result to the cache.
932 BasicBlock *BB, NonLocalDepInfo *Cache, unsigned NumSortedEntries) {
935 // the cache set. If so, find it.
937 Cache->begin(), Cache->begin() + NumSortedEntries, NonLocalDepEntry(BB));
938 if (Entry != Cache->begin() && (Entry - 1)->getBB() == BB)
942 if (Entry != Cache->begin() + NumSortedEntries && Entry->getBB() == BB)
952 // Otherwise, we have to scan for the value. If we have a dirty cache
962 // Eliminating the dirty entry from 'Cache', so update the reverse info.
978 Cache->push_back(NonLocalDepEntry(BB, Dep));
982 // to Cache!
995 /// Sort the NonLocalDepInfo cache, given a certain number of elements in the
1000 SortNonLocalDepInfoCache(MemoryDependenceResults::NonLocalDepInfo &Cache,
1002 switch (Cache.size() - NumSortedEntries) {
1008 NonLocalDepEntry Val = Cache.back();
1009 Cache.pop_back();
1011 std::upper_bound(Cache.begin(), Cache.end() - 1, Val);
1012 Cache.insert(Entry, Val);
1017 if (Cache.size() != 1) {
1018 NonLocalDepEntry Val = Cache.back();
1019 Cache.pop_back();
1021 std::upper_bound(Cache.begin(), Cache.end(), Val);
1022 Cache.insert(Entry, Val);
1027 std::sort(Cache.begin(), Cache.end());
1067 // If we already have a cache entry for this CacheKey, we may need to do some
1068 // work to reconcile the cache entry and the current query.
1106 NonLocalDepInfo *Cache = &CacheInfo->NonLocalDeps;
1117 for (auto &Entry : *Cache) {
1131 for (auto &Entry : *Cache) {
1146 // Otherwise, either this is a new block, a block with an invalid cache
1148 // than its valid cache info. If empty, the result will be valid cache info,
1150 if (Cache->empty())
1166 unsigned NumSortedEntries = Cache->size();
1169 DEBUG(AssertSorted(*Cache));
1180 // cache value will only see properly sorted cache arrays.
1181 if (Cache && NumSortedEntries != Cache->size()) {
1182 SortNonLocalDepInfoCache(*Cache, NumSortedEntries);
1184 // Since we bail out, the "Cache" set won't contain all of the
1200 DEBUG(AssertSorted(*Cache, NumSortedEntries));
1202 Cache, NumSortedEntries);
1259 // We may have added values to the cache list before this PHI translation.
1260 // If so, we haven't done anything to ensure that the cache remains sorted.
1262 // getNonLocalPointerDepFromBB and other routines that could reuse the cache
1263 // value will only see properly sorted cache arrays.
1264 if (Cache && NumSortedEntries != Cache->size()) {
1265 SortNonLocalDepInfoCache(*Cache, NumSortedEntries);
1266 NumSortedEntries = Cache->size();
1268 Cache = nullptr;
1344 // Since we had a phi translation failure, the cache for CacheKey won't
1355 // Refresh the CacheInfo/Cache pointer so that it isn't invalidated.
1357 Cache = &CacheInfo->NonLocalDeps;
1358 NumSortedEntries = Cache->size();
1360 // Since we did phi translation, the "Cache" set won't contain all of the
1373 if (!Cache) {
1374 // Refresh the CacheInfo/Cache pointer if it got invalidated.
1376 Cache = &CacheInfo->NonLocalDeps;
1377 NumSortedEntries = Cache->size();
1380 // Since we failed phi translation, the "Cache" set won't contain all of the
1395 for (NonLocalDepEntry &I : llvm::reverse(*Cache)) {
1409 assert((foundBlock || GotWorklistLimit) && "Current block not in cache?");
1412 // Okay, we're done now. If we added new values to the cache, re-sort it.
1413 SortNonLocalDepInfoCache(*Cache, NumSortedEntries);
1414 DEBUG(AssertSorted(*Cache));
1435 // Eliminating the dirty entry from 'Cache', so update the reverse info.
1582 // The cache is not valid for any specific block anymore.