Lines Matching +full:non +full:- +full:interleaved
1 /*===- InstrProfilingValue.c - Support library for PGO instrumentation ----===*\
5 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 \*===----------------------------------------------------------------------===*/
64 #pragma GCC diagnostic ignored "-Wcast-qual" in __llvm_profile_set_num_value_sites()
67 #pragma clang diagnostic ignored "-Wcast-qual" in __llvm_profile_set_num_value_sites()
69 *((uint16_t *)&Data->NumValueSites[ValueKind]) = NumValueSites; in __llvm_profile_set_num_value_sites()
86 return Data->FunctionPointer; in __llvm_get_function_addr()
108 NumVSites += Data->NumValueSites[VKI]; in allocateValueProfileCounters()
110 // If NumVSites = 0, calloc is allowed to return a non-null pointer. in allocateValueProfileCounters()
116 if (!COMPILER_RT_BOOL_CMPXCHG(&Data->Values, 0, Mem)) { in allocateValueProfileCounters()
133 " Consider using option -mllvm -vp-counters-per-site=<n> to " in allocateOneNode()
157 if (!PData->Values) { in instrumentTargetValueImpl()
162 ValueProfNode **ValueCounters = (ValueProfNode **)PData->Values; in instrumentTargetValueImpl()
170 if (TargetValue == CurVNode->Value) { in instrumentTargetValueImpl()
171 CurVNode->Count += CountValue; in instrumentTargetValueImpl()
174 if (CurVNode->Count < MinCount) { in instrumentTargetValueImpl()
175 MinCount = CurVNode->Count; in instrumentTargetValueImpl()
179 CurVNode = CurVNode->Next; in instrumentTargetValueImpl()
198 * to target loss. For instance, out of \c N value slots, \c N-1 in instrumentTargetValueImpl()
201 * very hot targets. If those hot targets occur in an interleaved in instrumentTargetValueImpl()
203 * other established entries) due to the ping-pong effect. in instrumentTargetValueImpl()
207 * the runtime to track the total number of evictions per-site. in instrumentTargetValueImpl()
212 if (MinCountVNode->Count <= CountValue) { in instrumentTargetValueImpl()
214 CurVNode->Value = TargetValue; in instrumentTargetValueImpl()
215 CurVNode->Count = CountValue; in instrumentTargetValueImpl()
217 MinCountVNode->Count -= CountValue; in instrumentTargetValueImpl()
225 CurVNode->Value = TargetValue; in instrumentTargetValueImpl()
226 CurVNode->Count += CountValue; in instrumentTargetValueImpl()
232 else if (PrevVNode && !PrevVNode->Next) in instrumentTargetValueImpl()
233 Success = COMPILER_RT_BOOL_CMPXCHG(&(PrevVNode->Next), 0, CurVNode); in instrumentTargetValueImpl()
281 return ((const ValueProfRuntimeRecord *)R)->Data->NumValueSites[VK]; in getNumValueSitesRT()
287 if (Record->SiteCountArray[VK] == INSTR_PROF_NULLPTR) in getNumValueDataRT()
289 for (I = 0; I < Record->Data->NumValueSites[VK]; I++) in getNumValueDataRT()
290 S += Record->SiteCountArray[VK][I]; in getNumValueDataRT()
297 return Record->SiteCountArray[VK][S]; in getNumValueDataForSiteRT()
313 ValueProfNode **Nodes = (ValueProfNode **)Data->Values; in initializeValueProfRuntimeRecord()
317 uint16_t N = Data->NumValueSites[I]; in initializeValueProfRuntimeRecord()
331 Site = Site->Next; in initializeValueProfRuntimeRecord()
348 Dst[I].Value = VNode->Value; in getNextNValueData()
349 Dst[I].Count = VNode->Count; in getNextNValueData()
350 VNode = VNode->Next; in getNextNValueData()