[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 14:13:37 PDT 2022
yota9 marked an inline comment as done.
yota9 added a comment.
In D127223#3564746 <https://reviews.llvm.org/D127223#3564746>, @maksfb wrote:
>> Some of the passes that calculates tentative layout like LongJmp and Golang are expecting that only functions with valid index will be located in hot text section.
>
> Do these passes care about functions written to cold text at all? I wonder if we need to assign indices to all functions regardless of the profile.
Sure, they are. E.g. we need to know exact layout to perform all the relaxations in jumps/calls in/to hot/cold sections.
We don't need to assign indices to cold functions since we get them from getSortedFunctions() vector one by one. But we need to know the boundaries between hot and cold parts and should know exactly in which section the function goest to or its part. Using the indices we easily see that the first part of the sorted functions vector contains hot/split functions and the second part only cold functions and easily can perform right layout calculations.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127223/new/
https://reviews.llvm.org/D127223
More information about the llvm-commits
mailing list