Skip to content
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

[BOLT] Use disambiguated local names in BAT YAML #91773

Merged

Conversation

aaupov
Copy link
Contributor

@aaupov aaupov commented May 10, 2024

Align BAT YAML to fdata profile.

Test Plan: updated register-fragments-bolt-symbols.s

aaupov added 2 commits May 10, 2024 10:30
Created using spr 1.3.4
@llvmbot
Copy link
Member

llvmbot commented May 10, 2024

@llvm/pr-subscribers-bolt

Author: Amir Ayupov (aaupov)

Changes

Align BAT YAML to fdata profile.

Test Plan: updated register-fragments-bolt-symbols.s


Full diff: https://github.com/llvm/llvm-project/pull/91773.diff

2 Files Affected:

  • (modified) bolt/lib/Profile/DataAggregator.cpp (+1-1)
  • (modified) bolt/test/X86/register-fragments-bolt-symbols.s (+5)
diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp
index 4ca6ef633e7db..afbab6ffceece 100644
--- a/bolt/lib/Profile/DataAggregator.cpp
+++ b/bolt/lib/Profile/DataAggregator.cpp
@@ -2333,7 +2333,7 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
         continue;
       BinaryFunction *BF = BC.getBinaryFunctionAtAddress(FuncAddress);
       assert(BF);
-      YamlBF.Name = FuncName.str();
+      YamlBF.Name = getLocationName(*BF);
       YamlBF.Id = BF->getFunctionNumber();
       YamlBF.Hash = BAT->getBFHash(FuncAddress);
       YamlBF.ExecCount = BF->getKnownExecutionCount();
diff --git a/bolt/test/X86/register-fragments-bolt-symbols.s b/bolt/test/X86/register-fragments-bolt-symbols.s
index fa9b70e0b2d89..6478adf19372b 100644
--- a/bolt/test/X86/register-fragments-bolt-symbols.s
+++ b/bolt/test/X86/register-fragments-bolt-symbols.s
@@ -15,6 +15,8 @@
 # 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
+# RUN: FileCheck --input-file %t.bat.fdata --check-prefix=CHECK-FDATA %s
+# RUN: FileCheck --input-file %t.bat.yaml --check-prefix=CHECK-YAML %s
 
 # CHECK-SYMS: l df *ABS*          [[#]] chain.s
 # CHECK-SYMS: l  F .bolt.org.text [[#]] chain
@@ -24,6 +26,9 @@
 
 # CHECK-REGISTER: BOLT-INFO: marking chain.cold.0/1(*2) as a fragment of chain/2(*2)
 
+# CHECK-FDATA: 0 [unknown] 0 1 chain/chain.s/2 10 0 1
+# CHECK-YAML: - name: 'chain/chain.s/2'
+
 .file "chain.s"
         .text
         .type   chain, @function

HerrCai0907 and others added 2 commits May 10, 2024 22:17
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
@aaupov aaupov changed the base branch from users/aaupov/spr/main.bolt-use-disambiguated-local-names-in-bat-yaml to main May 11, 2024 05:18
@aaupov aaupov merged commit bbcdd4f into main May 11, 2024
4 of 5 checks passed
@aaupov aaupov deleted the users/aaupov/spr/bolt-use-disambiguated-local-names-in-bat-yaml branch May 11, 2024 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants