-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[BOLT][AArch64] Reduce the number of ADR relaxations #111577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| ## Check that llvm-bolt will unnecessarily relax ADR instruction. | ||
|
||
| ## ADR below references containing function that is split. But ADR is always | ||
| ## in the main fragment, thus there is no need to relax it. | ||
|
|
||
| # RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o | ||
| # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -static | ||
| # RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=randomN \ | ||
| # RUN: 2>&1 | FileCheck %s | ||
| # RUN: llvm-objdump -d --disassemble-symbols=_start %t.bolt | FileCheck %s | ||
|
|
||
| # CHECK-NOT: adrp | ||
|
||
|
|
||
| .text | ||
| .globl _start | ||
| .type _start, %function | ||
| _start: | ||
| .cfi_startproc | ||
| adr x1, _start | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation |
||
| cmp x1, x11 | ||
| b.hi .L1 | ||
|
|
||
| mov x0, #0x0 | ||
|
|
||
| .L1: | ||
| ret x30 | ||
|
|
||
| .cfi_endproc | ||
| .size _start, .-_start | ||
|
|
||
| ## Force relocation mode. | ||
| .reloc 0, R_AARCH64_NONE | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me. Can we add a negative test? (e.g. one where the func is not in the main fragment to show the adrp is still there?)