summaryrefslogtreecommitdiff
path: root/bolt/test
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@fb.com>2023-01-20 15:50:59 -0800
committerAmir Ayupov <aaupov@fb.com>2023-01-20 19:23:06 -0800
commite5e07b01d8cf507a6f7987e3006ed2ebc72a236f (patch)
treeace94e9b41bb4fbc83ff15dcba3603a0c25182b1 /bolt/test
parentc1fc5219cb23d1e14c0115381321f6d8d6a4fc17 (diff)
downloadllvm-e5e07b01d8cf507a6f7987e3006ed2ebc72a236f.tar.gz
[BOLT] Handle __uniq suffix added by -funique-internal-linkage-names
In profile matching, if `.__uniq` suffix added for internal linkage symbols with `-funique-internal-linkage-names` prevents BOLT from matching to a binary function, try to strip the suffix and perform fuzzy name matching. Follow-up to D124117. Reviewed By: #bolt, maksfb Differential Revision: https://reviews.llvm.org/D142073
Diffstat (limited to 'bolt/test')
-rw-r--r--bolt/test/X86/lto-name-match.s24
1 files changed, 21 insertions, 3 deletions
diff --git a/bolt/test/X86/lto-name-match.s b/bolt/test/X86/lto-name-match.s
index a4dde00321d2..32d2e0ae40db 100644
--- a/bolt/test/X86/lto-name-match.s
+++ b/bolt/test/X86/lto-name-match.s
@@ -1,5 +1,3 @@
-# REQUIRES: system-linux
-
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: llvm-strip --strip-unneeded %t.o
@@ -9,7 +7,7 @@
## Check that profile is correctly matched by functions with variable suffixes.
## E.g., LTO-generated name foo.llvm.123 should match foo.llvm.*.
-# CHECK: 4 out of {{.*}} functions in the binary {{.*}} have non-empty execution profile
+# CHECK: 6 out of {{.*}} functions in the binary {{.*}} have non-empty execution profile
# CHECK-NOT: profile for {{.*}} objects was ignored
.globl _start
@@ -27,6 +25,14 @@ LL_start_2:
# FDATA: 1 _start #LL_start_2# 1 foo.lto_priv.321 0 0 1
call foo.lto_priv.123
+LL_start_3:
+# FDATA: 1 _start #LL_start_3# 1 foo.__uniq.321 0 0 1
+ call foo.__uniq.123
+
+LL_start_4:
+# FDATA: 1 _start #LL_start_4# 1 foo.__uniq.654.llvm.321 0 0 1
+ call foo.__uniq.456.llvm.123
+
call exit
.size _start, .-_start
@@ -47,3 +53,15 @@ foo.constprop.123:
foo.lto_priv.123:
ret
.size foo.lto_priv.123, .-foo.lto_priv.123
+
+ .globl foo.__uniq.123
+ .type foo.__uniq.123,@function
+foo.__uniq.123:
+ ret
+ .size foo.__uniq.123, .-foo.__uniq.123
+
+ .globl foo.__uniq.456.llvm.123
+ .type foo.__uniq.456.llvm.123,@function
+foo.__uniq.456.llvm.123:
+ ret
+ .size foo.__uniq.456.llvm.123, .-foo.__uniq.456.llvm.123