Lines Matching defs:Weights
38 // Weights are for internal use only. They are used by heuristics to help to
41 // Using "Loop Branch Heuristics" we predict weights of edges for the
111 /// \brief Calculate edge weights for successors lead to unreachable.
153 // Return false here so that edge weights for InvokeInst could be decided
196 // Ensure there are weights for all of the successors. Note that the first
201 // Build up the final weights that will be used in a temporary buffer.
202 // Compute the sum of all weights to later decide whether they need to
205 SmallVector<uint32_t, 2> Weights;
206 Weights.reserve(TI->getNumSuccessors());
214 Weights.push_back(Weight->getZExtValue());
215 WeightSum += Weights.back();
217 assert(Weights.size() == TI->getNumSuccessors() && "Checked above");
219 // If the sum of weights does not fit in 32 bits, scale every weight down
226 Weights[i] /= ScalingFactor;
227 WeightSum += Weights[i];
235 setEdgeProbability(BB, i, {Weights[i], static_cast<uint32_t>(WeightSum)});
239 "Expected weights to scale down to 32 bits");
244 /// \brief Calculate edge weights for edges leading to cold blocks.
250 /// Return true if we could compute the weights for cold edges.
308 // Calculate Edge Weights using "Pointer Heuristics". Predict a comparsion
343 // Calculate Edge Weights using "Loop Branch Heuristics". Predict backedges