Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[COFF] Create range extension thunks for ARM64
On ARM64, this is normally necessary only after a module exceeds 128 MB in size (while the limit for thumb is 16 MB). For conditional branches, the range limit is only 1 MB though (the same as for thumb), and for the tbz instruction, the range is only 32 KB, which allows for a test much smaller than the full 128 MB. This fixes PR40467. Differential Revision: https://reviews.llvm.org/D57575 llvm-svn: 352929
- Loading branch information
Showing
5 changed files
with
97 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// REQUIRES: aarch64 | ||
// RUN: llvm-mc -filetype=obj -triple=aarch64-windows %s -o %t.obj | ||
// RUN: lld-link -entry:main -subsystem:console %t.obj -out:%t.exe -verbose 2>&1 | FileCheck -check-prefix=VERBOSE %s | ||
// RUN: llvm-objdump -d %t.exe | FileCheck -check-prefix=DISASM %s | ||
|
||
// VERBOSE: Added 1 thunks with margin {{.*}} in 1 passes | ||
|
||
.globl main | ||
.globl func1 | ||
.text | ||
main: | ||
tbz w0, #0, func1 | ||
ret | ||
.section .text$a, "xr" | ||
.space 0x8000 | ||
.section .text$b, "xr" | ||
func1: | ||
ret | ||
|
||
// DISASM: 0000000140001000 .text: | ||
// DISASM: 140001000: 40 00 00 36 tbz w0, #0, #8 <.text+0x8> | ||
// DISASM: 140001004: c0 03 5f d6 ret | ||
// DISASM: 140001008: 50 00 00 90 adrp x16, #32768 | ||
// DISASM: 14000100c: 10 52 00 91 add x16, x16, #20 | ||
// DISASM: 140001010: 00 02 1f d6 br x16 | ||
|
||
// DISASM: 140009014: c0 03 5f d6 ret |