diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:00:08 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:00:08 +0000 | 
| commit | c7dac04c3480f3c20487f912f77343139fce2d99 (patch) | |
| tree | 21a09bce0171e27bd1e92649db9df797fa097cea /lib/Transforms/IPO/PartialInlining.cpp | |
| parent | 044eb2f6afba375a914ac9d8024f8f5142bb912e (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/IPO/PartialInlining.cpp')
| -rw-r--r-- | lib/Transforms/IPO/PartialInlining.cpp | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/PartialInlining.cpp b/lib/Transforms/IPO/PartialInlining.cpp index 683655f1f68b..a9cfd8ded6fb 100644 --- a/lib/Transforms/IPO/PartialInlining.cpp +++ b/lib/Transforms/IPO/PartialInlining.cpp @@ -710,7 +710,7 @@ PartialInlinerImpl::computeOutliningInfo(Function *F) {  // Check if there is PGO data or user annoated branch data:  static bool hasProfileData(Function *F, FunctionOutliningInfo *OI) { -  if (F->getEntryCount()) +  if (F->hasProfileData())      return true;    // Now check if any of the entry block has MD_prof data:    for (auto *E : OI->Entries) { @@ -863,6 +863,7 @@ int PartialInlinerImpl::computeBBInlineCost(BasicBlock *BB) {      case Instruction::GetElementPtr:        if (cast<GetElementPtrInst>(I)->hasAllZeroIndices())          continue; +      break;      default:        break;      } @@ -1273,7 +1274,7 @@ std::pair<bool, Function *> PartialInlinerImpl::unswitchFunction(Function *F) {    // Only try to outline cold regions if we have a profile summary, which    // implies we have profiling information. -  if (PSI->hasProfileSummary() && F->getEntryCount().hasValue() && +  if (PSI->hasProfileSummary() && F->hasProfileData() &&        !DisableMultiRegionPartialInline) {      std::unique_ptr<FunctionOutliningMultiRegionInfo> OMRI =          computeOutliningColdRegionsInfo(F); @@ -1379,10 +1380,10 @@ bool PartialInlinerImpl::tryPartialInline(FunctionCloner &Cloner) {                              Cloner.ClonedFunc->user_end());    DenseMap<User *, uint64_t> CallSiteToProfCountMap; -  if (Cloner.OrigFunc->getEntryCount()) +  auto CalleeEntryCount = Cloner.OrigFunc->getEntryCount(); +  if (CalleeEntryCount)      computeCallsiteToProfCountMap(Cloner.ClonedFunc, CallSiteToProfCountMap); -  auto CalleeEntryCount = Cloner.OrigFunc->getEntryCount();    uint64_t CalleeEntryCountV = (CalleeEntryCount ? *CalleeEntryCount : 0);    bool AnyInline = false;  | 
