Lines Matching defs:Weights
3895 if (!Weights)
3898 assert(SI.getNumSuccessors() == Weights->size() &&
3902 all_of(Weights.getValue(), [](uint32_t W) { return W == 0; });
3904 if (AllZeroes || Weights.getValue().size() < 2)
3907 return MDBuilder(SI.getParent()->getContext()).createBranchWeights(*Weights);
3920 SmallVector<uint32_t, 8> Weights;
3924 Weights.push_back(CW);
3926 this->Weights = std::move(Weights);
3931 if (Weights) {
3932 assert(SI.getNumSuccessors() == Weights->size() &&
3938 Weights.getValue()[I->getCaseIndex() + 1] = Weights.getValue().back();
3939 Weights.getValue().pop_back();
3949 if (!Weights && W && *W) {
3951 Weights = SmallVector<uint32_t, 8>(SI.getNumSuccessors(), 0);
3952 Weights.getValue()[SI.getNumSuccessors() - 1] = *W;
3953 } else if (Weights) {
3955 Weights.getValue().push_back(W ? *W : 0);
3957 if (Weights)
3958 assert(SI.getNumSuccessors() == Weights->size() &&
3966 if (Weights)
3967 Weights->resize(0);
3973 if (!Weights)
3975 return Weights.getValue()[idx];
3983 if (!Weights && *W)
3984 Weights = SmallVector<uint32_t, 8>(SI.getNumSuccessors(), 0);
3986 if (Weights) {
3987 auto &OldW = Weights.getValue()[idx];