Lines Matching defs:Best
3432 std::optional<NonTrivialUnswitchCandidate> Best;
3459 if (!Best || CandidateCost < Best->Cost) {
3460 Best = Candidate;
3461 Best->Cost = CandidateCost;
3464 assert(Best && "Must be!");
3465 return *Best;
3518 NonTrivialUnswitchCandidate Best = findBestNonTrivialUnswitchCandidate(
3521 assert(Best.TI && "Failed to find loop unswitch candidate");
3522 assert(Best.Cost && "Failed to compute cost");
3524 if (*Best.Cost >= UnswitchThreshold) {
3525 LLVM_DEBUG(dbgs() << "Cannot unswitch, lowest cost found: " << *Best.Cost
3531 if (Best.hasPendingInjection()) {
3532 Best = injectPendingInvariantConditions(Best, L, DT, LI, AC, MSSAU);
3535 assert(!Best.hasPendingInjection() &&
3538 if (Best.TI != PartialIVCondBranch)
3542 if (auto *SI = dyn_cast<SelectInst>(Best.TI)) {
3549 Best.TI = turnSelectIntoBranch(SI, DT, LI, MSSAU, &AC);
3552 if (isGuard(Best.TI))
3553 Best.TI =
3554 turnGuardIntoBranch(cast<IntrinsicInst>(Best.TI), L, DT, LI, MSSAU);
3555 InsertFreeze = shouldInsertFreeze(L, *Best.TI, DT, AC);
3558 LLVM_DEBUG(dbgs() << " Unswitching non-trivial (cost = " << Best.Cost
3559 << ") terminator: " << *Best.TI << "\n");
3560 unswitchNontrivialInvariants(L, *Best.TI, Best.Invariants, PartialIVInfo, DT,