[PATCH] D127223: [BOLT] Set valid index for functions with profiles
Vladislav Khmelevsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 7 08:46:32 PDT 2022
yota9 updated this revision to Diff 434837.
yota9 added a comment.
Fix comment
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127223/new/
https://reviews.llvm.org/D127223
Files:
bolt/lib/Passes/BinaryPasses.cpp
bolt/lib/Passes/ReorderFunctions.cpp
Index: bolt/lib/Passes/ReorderFunctions.cpp
===================================================================
--- bolt/lib/Passes/ReorderFunctions.cpp
+++ bolt/lib/Passes/ReorderFunctions.cpp
@@ -128,6 +128,13 @@
}
}
+ // Assign valid index for functions with valid profile.
+ for (auto &it : BFs) {
+ BinaryFunction &BF = it.second;
+ if (!BF.hasValidIndex() && BF.hasValidProfile())
+ BF.setIndex(Index++);
+ }
+
if (opts::ReorderFunctions == RT_NONE)
return;
Index: bolt/lib/Passes/BinaryPasses.cpp
===================================================================
--- bolt/lib/Passes/BinaryPasses.cpp
+++ bolt/lib/Passes/BinaryPasses.cpp
@@ -1211,8 +1211,7 @@
continue;
}
- if (!UseColdSection || Function.hasValidIndex() ||
- Function.hasValidProfile())
+ if (!UseColdSection || Function.hasValidIndex())
Function.setCodeSectionName(BC.getMainCodeSectionName());
else
Function.setCodeSectionName(BC.getColdCodeSectionName());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127223.434837.patch
Type: text/x-patch
Size: 1015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220607/d86023c9/attachment.bin>
More information about the llvm-commits
mailing list