aboutsummaryrefslogtreecommitdiff
path: root/bolt/test
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@fb.com>2024-05-30 17:32:20 -0700
committerAmir Ayupov <aaupov@fb.com>2024-05-30 17:48:12 -0700
commite9954ec087d640809082f46d1c7e5ac1767b798d (patch)
tree9a65ced783f342759bb23599b404872bce833ee8 /bolt/test
parentf38d84ce328c2acdce372680a41d8cf6c1bdf7c4 (diff)
downloadllvm-e9954ec087d640809082f46d1c7e5ac1767b798d.zip
llvm-e9954ec087d640809082f46d1c7e5ac1767b798d.tar.gz
llvm-e9954ec087d640809082f46d1c7e5ac1767b798d.tar.bz2
[BOLT] Detect .warm split functions as cold fragments (#93759)
CDSplit splits functions up to three ways: main fragment with no suffix, and fragments with .cold and .warm suffixes. Add .warm suffix to the regex used to recognize split fragments. Test Plan: updated register-fragments-bolt-symbols.s
Diffstat (limited to 'bolt/test')
-rw-r--r--bolt/test/X86/register-fragments-bolt-symbols.s14
1 files changed, 13 insertions, 1 deletions
diff --git a/bolt/test/X86/register-fragments-bolt-symbols.s b/bolt/test/X86/register-fragments-bolt-symbols.s
index 90c402b..d4f39b7 100644
--- a/bolt/test/X86/register-fragments-bolt-symbols.s
+++ b/bolt/test/X86/register-fragments-bolt-symbols.s
@@ -3,8 +3,20 @@
# 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
+
+## Check warm fragment name matching (produced by cdsplit)
+# RUN: %clang %cflags %t.main.o -o %t.warm.exe -Wl,-q
+# RUN: llvm-bolt %t.warm.exe -o %t.warm.bolt --split-functions --split-strategy=cdsplit \
+# RUN: --call-scale=2 --data=%t.fdata --reorder-blocks=ext-tsp --enable-bat
+# RUN: link_fdata %s %t.warm.bolt %t.preagg.warm PREAGGWARM
+# PREAGGWARM: B X:0 #chain.warm# 1 0
+# RUN: perf2bolt %t.warm.bolt -p %t.preagg.warm --pa -o %t.warm.fdata -w %t.warm.yaml \
+# RUN: -v=1 | FileCheck %s --check-prefix=CHECK-BOLT-WARM
+
+# CHECK-BOLT-WARM: marking chain.warm/1(*2) as a fragment of chain
+
+# RUN: sed -i 's|chain|chain/2|g' %t.fdata
# 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 \