Home | History | Annotate | Download | only in Utils

Lines Matching full:weights

801     // Collect branch weights into a vector.
802 SmallVector<uint32_t, 8> Weights;
809 Weights.push_back(CI->getValue().getZExtValue());
815 std::swap(Weights[i.getCaseIndex() + 1], Weights.back());
816 Weights.pop_back();
822 if (HasWeight && Weights.size() >= 2)
825 Weights));
905 /// Get Weights of a given TerminatorInst, the default weight is at the front
909 SmallVectorImpl<uint64_t> &Weights) {
914 Weights.push_back(CI->getValue().getZExtValue());
921 assert(Weights.size() == 2);
924 std::swap(Weights.front(), Weights.back());
928 /// Keep halving the weights until all can fit in uint32_t.
929 static void FitWeights(MutableArrayRef<uint64_t> Weights) {
930 uint64_t Max = *std::max_element(Weights.begin(), Weights.end());
933 for (uint64_t &I : Weights)
971 SmallVector<uint64_t, 8> Weights;
976 GetBranchWeights(PTI, Weights);
978 if (Weights.size() != 1 + PredCases.size())
981 // If there are no predecessor weights but there are successor weights,
982 // populate Weights with 1, which will later be scaled to the sum of
983 // successor's weights
984 Weights.assign(1 + PredCases.size(), 1);
1008 Weights[0] += Weights[i + 1];
1009 std::swap(Weights[i + 1], Weights.back());
1010 Weights.pop_back();
1025 unsigned CasesFromPred = Weights.size();
1035 // PredDefaultWeight (Weights[0]).
1036 Weights.push_back(Weights[0] * SuccWeights[i + 1]);
1045 Weights[i] *= ValidTotalSuccWeight;
1047 Weights[0] *= SuccWeights[0];
1060 WeightsForHandled[PredCases[i].Value] = Weights[i + 1];
1061 std::swap(Weights[i + 1], Weights.back());
1062 Weights.pop_back();
1077 Weights.push_back(WeightsForHandled[BBCases[i].Value]);
1088 Weights.push_back(WeightsForHandled[I]);
1115 // Halve the weights if any of them cannot fit in an uint32_t
1116 FitWeights(Weights);
1118 SmallVector<uint32_t, 8> MDWeights(Weights.begin(), Weights.end());
2163 /// the weights in {Pred|Succ}{True|False}Weight. If one of PBI and BI does
2385 // We assume that total weights of a BranchInst can fit into 32 bits.
2410 // Halve the weights if any of them cannot fit in an uint32_t
2944 // Halve the weights if any of them cannot fit in an uint32_t
2972 // weights for PBI do not apply to the new select because the select's
3086 SmallVector<uint64_t, 8> Weights;
3089 GetBranchWeights(SI, Weights);
3090 if (Weights.size() == 1 + SI->getNumCases()) {
3092 (uint32_t)Weights[SI->findCaseValue(TrueVal).getSuccessorIndex()];
3094 (uint32_t)Weights[SI->findCaseValue(FalseVal).getSuccessorIndex()];
3223 SmallVector<uint64_t, 8> Weights;
3226 GetBranchWeights(SI, Weights);
3227 if (Weights.size() == 1 + SI->getNumCases()) {
3229 Weights[0] = (Weights[0] + 1) >> 1;
3230 Weights.push_back(Weights[0]);
3232 SmallVector<uint32_t, 8> MDWeights(Weights.begin(), Weights.end());
3946 SmallVector<uint64_t, 8> Weights;
3947 GetBranchWeights(SI, Weights);
3948 if (Weights.size() == 1 + SI->getNumCases()) {
3951 for (size_t I = 0, E = Weights.size(); I != E; ++I) {
3953 TrueWeight += Weights[I];
3955 FalseWeight += Weights[I];
4039 SmallVector<uint64_t, 8> Weights;
4042 GetBranchWeights(SI, Weights);
4043 HasWeight = (Weights.size() == 1 + SI->getNumCases());
4052 std::swap(Weights[Case.getCaseIndex() + 1], Weights.back());
4053 Weights.pop_back();
4060 if (HasWeight && Weights.size() >= 2) {
4061 SmallVector<uint32_t, 8> MDWeights(Weights.begin(), Weights.end());