Lines Matching refs:Weights
4423 if (!Weights) in buildProfBranchWeightsMD()
4426 assert(SI.getNumSuccessors() == Weights->size() && in buildProfBranchWeightsMD()
4429 bool AllZeroes = all_of(Weights.value(), [](uint32_t W) { return W == 0; }); in buildProfBranchWeightsMD()
4431 if (AllZeroes || Weights.value().size() < 2) in buildProfBranchWeightsMD()
4434 return MDBuilder(SI.getParent()->getContext()).createBranchWeights(*Weights); in buildProfBranchWeightsMD()
4447 SmallVector<uint32_t, 8> Weights; in init() local
4451 Weights.push_back(CW); in init()
4453 this->Weights = std::move(Weights); in init()
4458 if (Weights) { in removeCase()
4459 assert(SI.getNumSuccessors() == Weights->size() && in removeCase()
4465 Weights.value()[I->getCaseIndex() + 1] = Weights.value().back(); in removeCase()
4466 Weights.value().pop_back(); in removeCase()
4476 if (!Weights && W && *W) { in addCase()
4478 Weights = SmallVector<uint32_t, 8>(SI.getNumSuccessors(), 0); in addCase()
4479 Weights.value()[SI.getNumSuccessors() - 1] = *W; in addCase()
4480 } else if (Weights) { in addCase()
4482 Weights.value().push_back(W.value_or(0)); in addCase()
4484 if (Weights) in addCase()
4485 assert(SI.getNumSuccessors() == Weights->size() && in addCase()
4493 if (Weights) in eraseFromParent()
4494 Weights->resize(0); in eraseFromParent()
4500 if (!Weights) in getSuccessorWeight()
4502 return (*Weights)[idx]; in getSuccessorWeight()
4510 if (!Weights && *W) in setSuccessorWeight()
4511 Weights = SmallVector<uint32_t, 8>(SI.getNumSuccessors(), 0); in setSuccessorWeight()
4513 if (Weights) { in setSuccessorWeight()
4514 auto &OldW = (*Weights)[idx]; in setSuccessorWeight()