diff options
Diffstat (limited to 'bolt/lib')
| -rw-r--r-- | bolt/lib/Core/BinaryFunction.cpp | 16 | ||||
| -rw-r--r-- | bolt/lib/Passes/BinaryPasses.cpp | 17 | ||||
| -rw-r--r-- | bolt/lib/Profile/YAMLProfileReader.cpp | 3 | 
3 files changed, 13 insertions, 23 deletions
| diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp index 84023ef..fbe1864 100644 --- a/bolt/lib/Core/BinaryFunction.cpp +++ b/bolt/lib/Core/BinaryFunction.cpp @@ -1699,9 +1699,19 @@ bool BinaryFunction::scanExternalRefs() {        const uint64_t FunctionOffset =            TargetAddress - TargetFunction->getAddress(); -      BranchTargetSymbol = -          FunctionOffset ? TargetFunction->addEntryPointAtOffset(FunctionOffset) -                         : TargetFunction->getSymbol(); +      if (!TargetFunction->isInConstantIsland(TargetAddress)) { +        BranchTargetSymbol = +            FunctionOffset +                ? TargetFunction->addEntryPointAtOffset(FunctionOffset) +                : TargetFunction->getSymbol(); +      } else { +        TargetFunction->setIgnored(); +        BC.outs() << "BOLT-WARNING: Ignoring entry point at address 0x" +                  << Twine::utohexstr(Address) +                  << " in constant island of function " << *TargetFunction +                  << '\n'; +        continue; +      }      }      // Can't find more references. Not creating relocations since we are not diff --git a/bolt/lib/Passes/BinaryPasses.cpp b/bolt/lib/Passes/BinaryPasses.cpp index e1a1856..1d187de 100644 --- a/bolt/lib/Passes/BinaryPasses.cpp +++ b/bolt/lib/Passes/BinaryPasses.cpp @@ -1508,12 +1508,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {    if (NumAllStaleFunctions) {      const float PctStale =          NumAllStaleFunctions / (float)NumAllProfiledFunctions * 100.0f; -    const float PctStaleFuncsWithEqualBlockCount = -        (float)BC.Stats.NumStaleFuncsWithEqualBlockCount / -        NumAllStaleFunctions * 100.0f; -    const float PctStaleBlocksWithEqualIcount = -        (float)BC.Stats.NumStaleBlocksWithEqualIcount / -        BC.Stats.NumStaleBlocks * 100.0f;      auto printErrorOrWarning = [&]() {        if (PctStale > opts::StaleThreshold)          BC.errs() << "BOLT-ERROR: "; @@ -1536,17 +1530,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {                  << "%) belong to functions with invalid"                     " (possibly stale) profile.\n";      } -    BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleFuncsWithEqualBlockCount -              << " stale function" -              << (BC.Stats.NumStaleFuncsWithEqualBlockCount == 1 ? "" : "s") -              << format(" (%.1f%% of all stale)", -                        PctStaleFuncsWithEqualBlockCount) -              << " have matching block count.\n"; -    BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleBlocksWithEqualIcount -              << " stale block" -              << (BC.Stats.NumStaleBlocksWithEqualIcount == 1 ? "" : "s") -              << format(" (%.1f%% of all stale)", PctStaleBlocksWithEqualIcount) -              << " have matching icount.\n";      if (PctStale > opts::StaleThreshold) {        return createFatalBOLTError(            Twine("BOLT-ERROR: stale functions exceed specified threshold of ") + diff --git a/bolt/lib/Profile/YAMLProfileReader.cpp b/bolt/lib/Profile/YAMLProfileReader.cpp index 086e47b..f0f87f9 100644 --- a/bolt/lib/Profile/YAMLProfileReader.cpp +++ b/bolt/lib/Profile/YAMLProfileReader.cpp @@ -350,9 +350,6 @@ bool YAMLProfileReader::parseFunctionProfile(               << MismatchedCalls << " calls, and " << MismatchedEdges               << " edges in profile did not match function " << BF << '\n'; -    if (YamlBF.NumBasicBlocks != BF.size()) -      ++BC.Stats.NumStaleFuncsWithEqualBlockCount; -      if (!opts::InferStaleProfile)        return false;      ArrayRef<ProbeMatchSpec> ProbeMatchSpecs; | 
