[PATCH] D152840: [ELF] A new code layout algorithm for function reordering [3a/3]
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 21 09:43:50 PDT 2023
MaskRay added a comment.
In D152840#4649238 <https://reviews.llvm.org/D152840#4649238>, @spupyrev wrote:
>> D159526 <https://reviews.llvm.org/D159526> performed the rename. If this patch is applied, `applyCDSort` in lld/ELF will need to be updated again. This is exactly the scenario I want to avoid.
>
> Can you explain why renaming a function might be a problem and we may want to avoid this either in the linker or in the compiler?
>
> I am not fully convinced that the newly proposed naming is preferred over the existing one. The new algorithm is called "cdsort" (which mimics the existing and commonly accepted name of "hfsort"), and it makes a sense to call the corresponding function "applyCDSort" as in "applyAlgorithmX". In contrast, "computeXXXlayout" might feel confusing, since the word "layout" often means a process.
I think `apply*` is often used when some structs are changed, e.g. `applyDomTreeUpdates`.
If we have a section order, then we use that to change the list of sections, we can say `apply...`.
If we just compute the section order, `apply*` is not appropriate.
`compute*` is the conventional name here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152840/new/
https://reviews.llvm.org/D152840
More information about the llvm-commits
mailing list