[PATCH] D152338: [BOLT] Handle recursive calls as inter-branches in DataAggregator
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 8 04:17:17 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc061f755546e: [BOLT] Handle recursive calls as inter-branches in DataAggregator (authored by Amir).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152338/new/
https://reviews.llvm.org/D152338
Files:
bolt/lib/Profile/DataAggregator.cpp
bolt/test/X86/Inputs/pre-aggregated.txt
bolt/test/X86/pre-aggregated-perf.test
Index: bolt/test/X86/pre-aggregated-perf.test
===================================================================
--- bolt/test/X86/pre-aggregated-perf.test
+++ bolt/test/X86/pre-aggregated-perf.test
@@ -43,6 +43,11 @@
PERF2BOLT: 1 usqrt 3d 1 usqrt 3f 0 22
PERF2BOLT: 1 usqrt a 1 usqrt 10 0 22
+NEWFORMAT: - name: 'frame_dummy/1'
+NEWFORMAT: fid: 3
+NEWFORMAT: hash: 0x24496F7F9594E89F
+NEWFORMAT: exec: 1
+
NEWFORMAT: - name: usqrt
NEWFORMAT: fid: 7
NEWFORMAT: exec: 0
Index: bolt/test/X86/Inputs/pre-aggregated.txt
===================================================================
--- bolt/test/X86/Inputs/pre-aggregated.txt
+++ bolt/test/X86/Inputs/pre-aggregated.txt
@@ -6,3 +6,4 @@
B 4011a0 4011a9 33 4
B 4011ad 401180 58 0
F 401170 4011b2 22
+B 400dae 400d90 1 0
Index: bolt/lib/Profile/DataAggregator.cpp
===================================================================
--- bolt/lib/Profile/DataAggregator.cpp
+++ bolt/lib/Profile/DataAggregator.cpp
@@ -777,7 +777,8 @@
if (!FromFunc && !ToFunc)
return false;
- if (FromFunc == ToFunc) {
+ // Treat recursive control transfers as inter-branches.
+ if (FromFunc == ToFunc && (To != ToFunc->getAddress())) {
recordBranch(*FromFunc, From - FromFunc->getAddress(),
To - FromFunc->getAddress(), Count, Mispreds);
return doIntraBranch(*FromFunc, From, To, Count, Mispreds);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152338.529553.patch
Type: text/x-patch
Size: 1477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230608/029aa6e1/attachment.bin>
More information about the llvm-commits
mailing list