Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1754,8 +1754,7 @@ void BinaryFunction::postProcessEntryPoints() {
// In non-relocation mode there's potentially an external undetectable
// reference to the entry point and hence we cannot move this entry
// point. Optimizing without moving could be difficult.
// In aggregation, register any known entry points for CFG construction.
if (!BC.HasRelocations && !opts::AggregateOnly)
if (!BC.HasRelocations)
setSimple(false);

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

if (!isSimple()) {
if (!isSimple() && !opts::AggregateOnly) {
assert(!BC.HasRelocations &&
"cannot process file with non-simple function in relocs mode");
return createNonFatalBOLTError("");
Expand Down
2 changes: 1 addition & 1 deletion bolt/lib/Profile/DataAggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ DataAggregator::getFallthroughsInTrace(BinaryFunction &BF,

BinaryContext &BC = BF.getBinaryContext();

if (!BF.isSimple())
if (BF.empty())
return std::nullopt;

assert(BF.hasCFG() && "can only record traces in CFG state");
Expand Down
3 changes: 2 additions & 1 deletion bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3438,7 +3438,8 @@ void RewriteInstance::buildFunctionsCFG() {
};

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

ParallelUtilities::runOnEachFunctionWithUniqueAllocId(
Expand Down