[lld] [lld][InstrProf] Profile guided function order (PR #96268)
Kyungwoo Lee via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 9 16:34:23 PDT 2024
================
@@ -352,7 +353,14 @@ void macho::PriorityBuilder::parseOrderFile(StringRef path) {
DenseMap<const InputSection *, size_t>
macho::PriorityBuilder::buildInputSectionPriorities() {
DenseMap<const InputSection *, size_t> sectionPriorities;
- if (config->callGraphProfileSort) {
+ if (!config->profileGuidedFunctionOrderPath.empty() ||
+ config->functionOrderForCompression || config->dataOrderForCompression) {
+ TimeTraceScope timeScope("Balanced Partitioning Section Orderer");
+ sectionPriorities = runBalancedPartitioning(
----------------
kyulee-com wrote:
Do you expect these orders to be overwritten by `-order_file` in the following path?
For the call-graph profile order, it appears interacting with the order file -- https://github.com/llvm/llvm-project/blob/main/lld/MachO/SectionPriorities.cpp#L288-L289 -- it appears prioritizing the order file followed by the call-graph order.
For the new usage -- irpgo order or compression order, I'd simply return from here, not to interact with the order file.
https://github.com/llvm/llvm-project/pull/96268
More information about the llvm-commits
mailing list