forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'amd-staging' of ssh://gerrit-git.amd.com:29418/lightnin…
…g/ec/llvm-project into amd-staging
- Loading branch information
Showing
231 changed files
with
4,481 additions
and
2,080 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# If the operand references a symbol that differs from the jump table label, | ||
# no reference updating is required even if its target address resides within | ||
# the jump table's range. | ||
# In this test case, consider the second instruction within the main function, | ||
# where the address resulting from 'c + 17' corresponds to one byte beyond the | ||
# address of the .LJTI2_0 jump table label. However, this operand represents | ||
# an offset calculation related to the global variable 'c' and should remain | ||
# unaffected by the jump table. | ||
|
||
# REQUIRES: system-linux | ||
|
||
|
||
# RUN: %clang -no-pie %s -o %t.exe -Wl,-q | ||
|
||
# RUN: %t.exe | ||
# RUN: llvm-bolt -funcs=main,foo/1 %t.exe -o %t.exe.bolt -jump-tables=move | ||
# RUN: %t.exe.bolt | ||
|
||
.text | ||
.globl main | ||
.type main,@function | ||
main: | ||
pushq %rbp | ||
movq %rsp, %rbp | ||
movq $-16, %rax | ||
movl c+17(%rax), %edx | ||
cmpl $255, %edx | ||
je .LCorrect | ||
movl $1, %eax | ||
popq %rbp | ||
ret | ||
.LCorrect: | ||
movl $0, %eax | ||
popq %rbp | ||
ret | ||
.p2align 4, 0x90 | ||
.type foo,@function | ||
foo: | ||
movq $0, %rax | ||
jmpq *.LJTI2_0(,%rax,8) | ||
addl $-36, %eax | ||
.LBB2_2: | ||
addl $-16, %eax | ||
retq | ||
.section .rodata,"a",@progbits | ||
.type c,@object | ||
.data | ||
.globl c | ||
.p2align 4, 0x0 | ||
c: | ||
.byte 1 | ||
.byte 0xff | ||
.zero 14 | ||
.size c, 16 | ||
.LJTI2_0: | ||
.quad .LBB2_2 | ||
.quad .LBB2_2 | ||
.quad .LBB2_2 | ||
.quad .LBB2_2 | ||
|
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,32 @@ | ||
# Test the heuristics for matching BOLT-added split functions. | ||
|
||
# RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %S/cdsplit-symbol-names.s -o %t.main.o | ||
# RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.chain.o | ||
# RUN: link_fdata %S/cdsplit-symbol-names.s %t.main.o %t.fdata | ||
# RUN: sed -i 's|chain|chain/2|g' %t.fdata | ||
# RUN: llvm-strip --strip-unneeded %t.main.o | ||
# RUN: llvm-objcopy --localize-symbol=chain %t.main.o | ||
# RUN: %clang %cflags %t.chain.o %t.main.o -o %t.exe -Wl,-q | ||
# RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=randomN \ | ||
# RUN: --reorder-blocks=ext-tsp --enable-bat --bolt-seed=7 --data=%t.fdata | ||
# RUN: llvm-objdump --syms %t.bolt | FileCheck %s --check-prefix=CHECK-SYMS | ||
|
||
# RUN: link_fdata %s %t.bolt %t.preagg PREAGG | ||
# PREAGG: B X:0 #chain.cold.0# 1 0 | ||
# RUN: perf2bolt %t.bolt -p %t.preagg --pa -o %t.bat.fdata -w %t.bat.yaml -v=1 \ | ||
# RUN: | FileCheck %s --check-prefix=CHECK-REGISTER | ||
|
||
# CHECK-SYMS: l df *ABS* [[#]] chain.s | ||
# CHECK-SYMS: l F .bolt.org.text [[#]] chain | ||
# CHECK-SYMS: l F .text.cold [[#]] chain.cold.0 | ||
# CHECK-SYMS: l F .text [[#]] chain | ||
# CHECK-SYMS: l df *ABS* [[#]] bolt-pseudo.o | ||
|
||
# CHECK-REGISTER: BOLT-INFO: marking chain.cold.0/1(*2) as a fragment of chain/2(*2) | ||
|
||
.file "chain.s" | ||
.text | ||
.type chain, @function | ||
chain: | ||
ret | ||
.size chain, .-chain |
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
Oops, something went wrong.