Skip to content
Merged
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: 3 additions & 2 deletions bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "bolt/Core/DynoStats.h"
#include "bolt/Core/HashUtilities.h"
#include "bolt/Core/MCPlusBuilder.h"
#include "bolt/Utils/CommandLineOpts.h"
#include "bolt/Utils/NameResolver.h"
#include "bolt/Utils/NameShortener.h"
#include "bolt/Utils/Utils.h"
Expand Down Expand Up @@ -1753,8 +1754,8 @@ 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 BAT mode, register any known entry points for CFG construction.
if (!BC.HasRelocations && !BC.HasBATSection)
// In aggregation, register any known entry points for CFG construction.
if (!BC.HasRelocations && !opts::AggregateOnly)
setSimple(false);

const uint32_t Offset = KV.first;
Expand Down
24 changes: 24 additions & 0 deletions bolt/test/X86/entry-point-fallthru.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Checks that fallthroughs spanning entry points are accepted in aggregation
## mode.

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: ld.lld %t.o -o %t
# RUN: link_fdata %s %t %t.preagg PREAGG
# RUN: perf2bolt %t -p %t.preagg --pa -o %t.fdata | FileCheck %s
# CHECK: traces mismatching disassembled function contents: 0

.globl main
main:
.cfi_startproc
vmovaps %zmm31,%zmm3

next:
add $0x4,%r9
add $0x40,%r10
dec %r14
Ljmp:
jne main
# PREAGG: T #Ljmp# #main# #Ljmp# 1
ret
.cfi_endproc
.size main,.-main