Lines Matching refs:Best
3409 std::optional<NonTrivialUnswitchCandidate> Best;
3436 if (!Best || CandidateCost < Best->Cost) {
3437 Best = Candidate;
3438 Best->Cost = CandidateCost;
3441 assert(Best && "Must be!");
3442 return *Best;
3495 NonTrivialUnswitchCandidate Best = findBestNonTrivialUnswitchCandidate(
3498 assert(Best.TI && "Failed to find loop unswitch candidate");
3499 assert(Best.Cost && "Failed to compute cost");
3501 if (*Best.Cost >= UnswitchThreshold) {
3502 LLVM_DEBUG(dbgs() << "Cannot unswitch, lowest cost found: " << *Best.Cost
3508 if (Best.hasPendingInjection()) {
3509 Best = injectPendingInvariantConditions(Best, L, DT, LI, AC, MSSAU);
3512 assert(!Best.hasPendingInjection() &&
3515 if (Best.TI != PartialIVCondBranch)
3519 if (auto *SI = dyn_cast<SelectInst>(Best.TI)) {
3526 Best.TI = turnSelectIntoBranch(SI, DT, LI, MSSAU, &AC);
3529 if (isGuard(Best.TI))
3530 Best.TI =
3531 turnGuardIntoBranch(cast<IntrinsicInst>(Best.TI), L, DT, LI, MSSAU);
3532 InsertFreeze = shouldInsertFreeze(L, *Best.TI, DT, AC);
3535 LLVM_DEBUG(dbgs() << " Unswitching non-trivial (cost = " << Best.Cost
3536 << ") terminator: " << *Best.TI << "\n");
3537 unswitchNontrivialInvariants(L, *Best.TI, Best.Invariants, PartialIVInfo, DT,