Home | History | Annotate | Download | only in Analysis

Lines Matching defs:Cache

604 /// cache arrays are properly kept sorted.
605 static void AssertSorted(MemoryDependenceAnalysis::NonLocalDepInfo &Cache,
607 if (Count == -1) Count = Cache.size();
611 assert(!(Cache[i] < Cache[i-1]) && "Cache isn't sorted!");
632 NonLocalDepInfo &Cache = CacheP.first;
640 if (!Cache.empty()) {
641 // Okay, we have a cache entry. If we know it is not dirty, just return it
645 return Cache;
650 for (NonLocalDepInfo::iterator I = Cache.begin(), E = Cache.end();
655 // Sort the cache so that we can do fast binary search lookups below.
656 std::sort(Cache.begin(), Cache.end());
660 // << Cache.size() << " cached: " << *QueryInst;
674 unsigned NumSortedEntries = Cache.size();
675 DEBUG(AssertSorted(Cache));
687 // the cache set. If so, find it.
688 DEBUG(AssertSorted(Cache, NumSortedEntries));
690 std::upper_bound(Cache.begin(), Cache.begin()+NumSortedEntries,
692 if (Entry != Cache.begin() && prior(Entry)->getBB() == DirtyBB)
696 if (Entry != Cache.begin()+NumSortedEntries &&
737 Cache.push_back(NonLocalDepEntry(DirtyBB, Dep));
755 return Cache;
790 /// Pointer/PointeeSize using either cached information in Cache or by doing a
791 /// lookup (which may use dirty cache info if available). If we do a lookup,
792 /// add the result to the cache.
796 NonLocalDepInfo *Cache, unsigned NumSortedEntries) {
799 // the cache set. If so, find it.
801 std::upper_bound(Cache->begin(), Cache->begin()+NumSortedEntries,
803 if (Entry != Cache->begin() && (Entry-1)->getBB() == BB)
807 if (Entry != Cache->begin()+NumSortedEntries && Entry->getBB() == BB)
817 // Otherwise, we have to scan for the value. If we have a dirty cache
827 // Eliminating the dirty entry from 'Cache', so update the reverse info.
842 Cache->push_back(NonLocalDepEntry(BB, Dep));
846 // to Cache!
859 /// SortNonLocalDepInfoCache - Sort the a NonLocalDepInfo cache, given a certain
863 SortNonLocalDepInfoCache(MemoryDependenceAnalysis::NonLocalDepInfo &Cache,
865 switch (Cache.size() - NumSortedEntries) {
871 NonLocalDepEntry Val = Cache.back();
872 Cache.pop_back();
874 std::upper_bound(Cache.begin(), Cache.end()-1, Val);
875 Cache.insert(Entry, Val);
880 if (Cache.size() != 1) {
881 NonLocalDepEntry Val = Cache.back();
882 Cache.pop_back();
884 std::upper_bound(Cache.begin(), Cache.end(), Val);
885 Cache.insert(Entry, Val);
890 std::sort(Cache.begin(), Cache.end());
932 // If we already have a cache entry for this CacheKey, we may need to do some
933 // work to reconcile the cache entry and the current query.
974 NonLocalDepInfo *Cache = &CacheInfo->NonLocalDeps;
985 for (NonLocalDepInfo::iterator I = Cache->begin(), E = Cache->end();
999 for (NonLocalDepInfo::iterator I = Cache->begin(), E = Cache->end();
1009 // Otherwise, either this is a new block, a block with an invalid cache
1011 // than its valid cache info. If empty, the result will be valid cache info,
1013 if (Cache->empty())
1029 unsigned NumSortedEntries = Cache->size();
1030 DEBUG(AssertSorted(*Cache));
1043 DEBUG(AssertSorted(*Cache, NumSortedEntries));
1044 MemDepResult Dep = GetNonLocalInfoForBlock(Loc, isLoad, BB, Cache,
1091 // We may have added values to the cache list before this PHI translation.
1092 // If so, we haven't done anything to ensure that the cache remains sorted.
1094 // getNonLocalPointerDepFromBB and other routines that could reuse the cache
1095 // value will only see properly sorted cache arrays.
1096 if (Cache && NumSortedEntries != Cache->size()) {
1097 SortNonLocalDepInfoCache(*Cache, NumSortedEntries);
1098 NumSortedEntries = Cache->size();
1100 Cache = 0;
1179 cache for CacheKey won't
1190 // Refresh the CacheInfo/Cache pointer so that it isn't invalidated.
1192 Cache = &CacheInfo->NonLocalDeps;
1193 NumSortedEntries = Cache->size();
1195 // Since we did phi translation, the "Cache" set won't contain all of the
1208 if (Cache == 0) {
1209 // Refresh the CacheInfo/Cache pointer if it got invalidated.
1211 Cache = &CacheInfo->NonLocalDeps;
1212 NumSortedEntries = Cache->size();
1215 // Since we failed phi translation, the "Cache" set won't contain all of the
1229 for (NonLocalDepInfo::reverse_iterator I = Cache->rbegin(); ; ++I) {
1230 assert(I != Cache->rend() && "Didn't find current block??");
1243 // Okay, we're done now. If we added new values to the cache, re-sort it.
1244 SortNonLocalDepInfoCache(*Cache, NumSortedEntries);
1245 DEBUG(AssertSorted(*Cache));
1266 // Eliminating the dirty entry from 'Cache', so update the reverse info.
1299 /// This method attempts to keep the cache coherent using the reverse map.
1432 // The cache is not valid for any specific block anymore.