[all-commits] [llvm/llvm-project] 73eb9b: [InstrProf] Evaluate function order using test tra...
Ellis Hoag via All-commits
all-commits at lists.llvm.org
Thu May 23 11:19:51 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 73eb9b33147ba5157cbf5d8276ee718629dfbbda
https://github.com/llvm/llvm-project/commit/73eb9b33147ba5157cbf5d8276ee718629dfbbda
Author: Ellis Hoag <ellis.sparky.hoag at gmail.com>
Date: 2024-05-23 (Thu, 23 May 2024)
Changed paths:
M llvm/include/llvm/ProfileData/InstrProf.h
M llvm/lib/ProfileData/InstrProf.cpp
A llvm/test/tools/llvm-profdata/show-order-error.proftext
M llvm/test/tools/llvm-profdata/show-order.proftext
M llvm/tools/llvm-profdata/llvm-profdata.cpp
M llvm/unittests/ProfileData/BPFunctionNodeTest.cpp
Log Message:
-----------
[InstrProf] Evaluate function order using test traces (#92451)
The `llvm-profdata order` command is used to compute a function order
using traces from the input profile. Add the `--num-test-traces` flag to
keep aside N traces to evalute this order. These test traces are assumed
to be the actual function execution order in some experiment. The output
is a number that represents how many page faults we got. Lower is
better.
I tested on a large profile I already had.
```
llvm-profdata order default.profdata --num-test-traces=30
# Ordered 149103 functions
# Total area under the page fault curve: 2.271827e+09
...
```
I also improved `TemporalProfTraceTy::createBPFunctionNodes()` in a few
ways:
* Simplified how `UN`s are computed
* Change how the initial `Node` order is computed
* Filter out rare and common `UN`s
* Output vector is an aliased argument instead of a return
These changes slightly improved the evaluation in my test.
```
llvm-profdata order default.profdata --num-test-traces=30
# Ordered 149103 functions
# Total area under the page fault curve: 2.268586e+09
...
```
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list