llvm-project/bolt/test/X86/entry-point-fallthru.s
Amir Ayupov 3968ebd00d
[BOLT] Keep multi-entry functions simple in aggregation mode (#128253)
BOLT used to mark multi-entry functions non-simple in non-relocation
mode with the reasoning that we can't move them due to potentially
undetected references. However, in aggregation mode it doesn't apply as
BOLT doesn't perform optimizations.

Relax this constraint in case of an aggregation job.

Test Plan: added entry-point-fallthru.s
2025-02-25 10:53:45 -08:00

25 lines
557 B
ArmAsm

## 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