Lines Matching +full:down +full:- +full:counters

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"
67 #pragma clang diagnostic ignored "-Wcast-qual"
69 *((uint16_t *)&Data->NumValueSites[ValueKind]) = NumValueSites;
86 return Data->FunctionPointer;
108 NumVSites += Data->NumValueSites[VKI];
110 // If NumVSites = 0, calloc is allowed to return a non-null pointer.
116 if (!COMPILER_RT_BOOL_CMPXCHG(&Data->Values, 0, Mem)) {
133 " Consider using option -mllvm -vp-counters-per-site=<n> to "
135 " value profile counters at compile time. \n",
136 "Running out of static counters");
157 if (!PData->Values) {
162 ValueProfNode **ValueCounters = (ValueProfNode **)PData->Values;
170 if (TargetValue == CurVNode->Value) {
171 CurVNode->Count += CountValue;
174 if (CurVNode->Count < MinCount) {
175 MinCount = CurVNode->Count;
179 CurVNode = CurVNode->Next;
184 /* Bump down the min count node's count. If it reaches 0,
198 * to target loss. For instance, out of \c N value slots, \c N-1
203 * other established entries) due to the ping-pong effect.
207 * the runtime to track the total number of evictions per-site.
212 if (MinCountVNode->Count <= CountValue) {
214 CurVNode->Value = TargetValue;
215 CurVNode->Count = CountValue;
217 MinCountVNode->Count -= CountValue;
225 CurVNode->Value = TargetValue;
226 CurVNode->Count += CountValue;
232 else if (PrevVNode && !PrevVNode->Next)
233 Success = COMPILER_RT_BOOL_CMPXCHG(&(PrevVNode->Next), 0, CurVNode);
281 return ((const ValueProfRuntimeRecord *)R)->Data->NumValueSites[VK];
287 if (Record->SiteCountArray[VK] == INSTR_PROF_NULLPTR)
289 for (I = 0; I < Record->Data->NumValueSites[VK]; I++)
290 S += Record->SiteCountArray[VK][I];
297 return Record->SiteCountArray[VK][S];
313 ValueProfNode **Nodes = (ValueProfNode **)Data->Values;
317 uint16_t N = Data->NumValueSites[I];
331 Site = Site->Next;
348 Dst[I].Value = VNode->Value;
349 Dst[I].Count = VNode->Count;
350 VNode = VNode->Next;