Lines Matching full:cost

279     unsigned Cost = RBI->copyCost(*DesiredRegBank, *CurRegBank,  in getRepairCost()  local
282 if (Cost != std::numeric_limits<unsigned>::max()) in getRepairCost()
283 return Cost; in getRepairCost()
284 // Return the legalization cost of that repairing. in getRepairCost()
296 MappingCost Cost = MappingCost::ImpossibleCost(); in findBestMapping() local
301 computeMapping(MI, *CurMapping, LocalRepairPts, &Cost); in findBestMapping()
302 if (CurCost < Cost) { in findBestMapping()
304 Cost = CurCost; in findBestMapping()
384 // account for a repairing cost for each phi we silently change. in tryAvoidingSplit()
396 // in the repairing cost all the phi we changed. in tryAvoidingSplit()
430 // the repairing cost because of the PHIs already proceeded in tryAvoidingSplit()
433 assert(false && "Repairing cost may not be accurate"); in tryAvoidingSplit()
452 // If mapped with InstrMapping, MI will have the recorded cost. in computeMapping()
453 MappingCost Cost(MBFI ? MBFI->getBlockFreq(MI.getParent()) in computeMapping() local
455 bool Saturated = Cost.addLocalCost(InstrMapping.getCost()); in computeMapping()
456 assert(!Saturated && "Possible mapping saturated the cost"); in computeMapping()
457 LLVM_DEBUG(dbgs() << "Evaluating mapping cost for: " << MI); in computeMapping()
460 if (BestCost && Cost > *BestCost) { in computeMapping()
462 return Cost; in computeMapping()
468 // register banks. Account for that repairing cost as well. in computeMapping()
504 // we may give a higher cost to this mapping. in computeMapping()
515 // Account for the split cost and repair cost. in computeMapping()
516 // Unless the cost is already saturated or we do not care about the cost. in computeMapping()
522 assert(MBFI && MBPI && "Cost computation requires MBFI and MBPI"); in computeMapping()
524 // FIXME: We will have to rework the repairing cost model. in computeMapping()
525 // The repairing cost depends on the register bank that MO has. in computeMapping()
528 // For the fast mode, we don't compute the cost so that is fine, in computeMapping()
533 // Sums up the repairing cost of MO at each insertion point. in computeMapping()
536 // This is an impossible to repair cost. in computeMapping()
545 // overflow because the repairing cost is free of basic block in computeMapping()
555 Saturated = Cost.addLocalCost(RepairCost); in computeMapping()
566 Cost.saturate(); in computeMapping()
568 Saturated = Cost.addNonLocalCost(PtCost); in computeMapping()
573 if (BestCost && Cost > *BestCost) { in computeMapping()
575 return Cost; in computeMapping()
578 // No need to accumulate more cost information. in computeMapping()
584 LLVM_DEBUG(dbgs() << "Total cost is: " << Cost << "\n"); in computeMapping()
585 return Cost; in computeMapping()
982 bool RegBankSelect::MappingCost::addLocalCost(uint64_t Cost) { in addLocalCost() argument
984 if (LocalCost + Cost < LocalCost) { in addLocalCost()
988 LocalCost += Cost; in addLocalCost()
992 bool RegBankSelect::MappingCost::addNonLocalCost(uint64_t Cost) { in addNonLocalCost() argument
994 if (NonLocalCost + Cost < NonLocalCost) { in addNonLocalCost()
998 NonLocalCost += Cost; in addNonLocalCost()
1016 bool RegBankSelect::MappingCost::operator<(const MappingCost &Cost) const { in operator <()
1018 if (*this == Cost) in operator <()
1022 if ((*this == ImpossibleCost()) || (Cost == ImpossibleCost())) in operator <()
1023 return (*this == ImpossibleCost()) < (Cost == ImpossibleCost()); in operator <()
1026 if (isSaturated() || Cost.isSaturated()) in operator <()
1027 return isSaturated() < Cost.isSaturated(); in operator <()
1036 if (LLVM_LIKELY(LocalFreq == Cost.LocalFreq)) { in operator <()
1040 if (NonLocalCost == Cost.NonLocalCost) in operator <()
1043 return LocalCost < Cost.LocalCost; in operator <()
1049 if (LocalCost < Cost.LocalCost) in operator <()
1050 OtherLocalAdjust = Cost.LocalCost - LocalCost; in operator <()
1052 ThisLocalAdjust = LocalCost - Cost.LocalCost; in operator <()
1055 OtherLocalAdjust = Cost.LocalCost; in operator <()
1061 if (NonLocalCost < Cost.NonLocalCost) in operator <()
1062 OtherNonLocalAdjust = Cost.NonLocalCost - NonLocalCost; in operator <()
1064 ThisNonLocalAdjust = NonLocalCost - Cost.NonLocalCost; in operator <()
1070 uint64_t OtherScaledCost = OtherLocalAdjust * Cost.LocalFreq; in operator <()
1074 (OtherScaledCost < OtherLocalAdjust || OtherScaledCost < Cost.LocalFreq); in operator <()
1093 bool RegBankSelect::MappingCost::operator==(const MappingCost &Cost) const { in operator ==()
1094 return LocalCost == Cost.LocalCost && NonLocalCost == Cost.NonLocalCost && in operator ==()
1095 LocalFreq == Cost.LocalFreq; in operator ==()