Lines Matching defs:Best
3431 std::optional<NonTrivialUnswitchCandidate> Best;
3458 if (!Best || CandidateCost < Best->Cost) {
3459 Best = Candidate;
3460 Best->Cost = CandidateCost;
3463 assert(Best && "Must be!");
3464 return *Best;
3517 NonTrivialUnswitchCandidate Best = findBestNonTrivialUnswitchCandidate(
3520 assert(Best.TI && "Failed to find loop unswitch candidate");
3521 assert(Best.Cost && "Failed to compute cost");
3523 if (*Best.Cost >= UnswitchThreshold) {
3524 LLVM_DEBUG(dbgs() << "Cannot unswitch, lowest cost found: " << *Best.Cost
3530 if (Best.hasPendingInjection()) {
3531 Best = injectPendingInvariantConditions(Best, L, DT, LI, AC, MSSAU);
3534 assert(!Best.hasPendingInjection() &&
3537 if (Best.TI != PartialIVCondBranch)
3541 if (auto *SI = dyn_cast<SelectInst>(Best.TI)) {
3548 Best.TI = turnSelectIntoBranch(SI, DT, LI, MSSAU, &AC);
3551 if (isGuard(Best.TI))
3552 Best.TI =
3553 turnGuardIntoBranch(cast<IntrinsicInst>(Best.TI), L, DT, LI, MSSAU);
3554 InsertFreeze = shouldInsertFreeze(L, *Best.TI, DT, AC);
3557 LLVM_DEBUG(dbgs() << " Unswitching non-trivial (cost = " << Best.Cost
3558 << ") terminator: " << *Best.TI << "\n");
3559 unswitchNontrivialInvariants(L, *Best.TI, Best.Invariants, PartialIVInfo, DT,