Skip to content

Commit 72de324

Browse files
committed
[𝘀𝗽𝗿] initial version
Created using spr 1.3.4
1 parent f567524 commit 72de324

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,8 +1754,7 @@ void BinaryFunction::postProcessEntryPoints() {
17541754
// In non-relocation mode there's potentially an external undetectable
17551755
// reference to the entry point and hence we cannot move this entry
17561756
// point. Optimizing without moving could be difficult.
1757-
// In aggregation, register any known entry points for CFG construction.
1758-
if (!BC.HasRelocations && !opts::AggregateOnly)
1757+
if (!BC.HasRelocations)
17591758
setSimple(false);
17601759

17611760
const uint32_t Offset = KV.first;
@@ -2084,7 +2083,7 @@ void BinaryFunction::recomputeLandingPads() {
20842083
Error BinaryFunction::buildCFG(MCPlusBuilder::AllocatorIdTy AllocatorId) {
20852084
auto &MIB = BC.MIB;
20862085

2087-
if (!isSimple()) {
2086+
if (!isSimple() && !opts::AggregateOnly) {
20882087
assert(!BC.HasRelocations &&
20892088
"cannot process file with non-simple function in relocs mode");
20902089
return createNonFatalBOLTError("");

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ DataAggregator::getFallthroughsInTrace(BinaryFunction &BF,
871871

872872
BinaryContext &BC = BF.getBinaryContext();
873873

874-
if (!BF.isSimple())
874+
if (BF.empty())
875875
return std::nullopt;
876876

877877
assert(BF.hasCFG() && "can only record traces in CFG state");

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3438,7 +3438,8 @@ void RewriteInstance::buildFunctionsCFG() {
34383438
};
34393439

34403440
ParallelUtilities::PredicateTy SkipPredicate = [&](const BinaryFunction &BF) {
3441-
return !shouldDisassemble(BF) || !BF.isSimple();
3441+
// Construct CFG for non-simple functions in aggregation mode.
3442+
return !(shouldDisassemble(BF) && (BF.isSimple() || opts::AggregateOnly));
34423443
};
34433444

34443445
ParallelUtilities::runOnEachFunctionWithUniqueAllocId(

0 commit comments

Comments
 (0)