6 Commits

Author SHA1 Message Date
spupyrev
30aa9fb4c1 Revert "[InstrProf] Adding utility weights to BalancedPartitioning (#72717)"
This reverts commit 5954b9dca21bb0c69b9e991b2ddb84c8b05ecba3
due to broken Windows build
2024-01-19 15:13:47 -08:00
spupyrev
5954b9dca2
[InstrProf] Adding utility weights to BalancedPartitioning (#72717)
Adding weights to utility nodes in BP so that we can give more
importance to
certain utilities. This is useful when we optimize several objectives
jointly.
2024-01-19 13:36:59 -08:00
Ellis Hoag
c1d935ece3 [InstrProf] Fix BalancedPartitioning when threads are disabled
In https://reviews.llvm.org/D147812 we introduced the class
`BalancedPartitioning` which includes some threading code. The tests in
that diff run forever when built with `-DLLVM_ENABLE_THREADS=OFF` so
some bots were broken.

These tests were skipped in
https://reviews.llvm.org/rGa4845eaf2e9aa18dd900d7cbeff4e5ff52e4b50e
because of this.

This diff disables the threading code if `LLVM_ENABLE_THREADS` is
disabled so we can re-enable the tests.

Reviewed By: luporl

Differential Revision: https://reviews.llvm.org/D152390
2023-06-07 12:04:35 -07:00
Leandro Lupori
a4845eaf2e [InstrProf] Skip Balanced Partitioning tests on ARM
Balanced Partitioning tests, added by 1794532bb942, currently
hang on ARM, what causes check-all to never finish.

Issue #63168

Differential Revision: https://reviews.llvm.org/D147812
2023-06-07 17:39:41 +00:00
Ellis Hoag
1794532bb9 [InstrProf] Move BPFunctionNode test to ProfileDataTests
In https://reviews.llvm.org/D147812 I created
`BalancedPartitioningTest.cpp` and inadvertently drastically increased the
number of files needed to compile `SupportTests`. Instead lets move the
`BPFunctionNode` test to `unittests/ProfileData` so we can remove the
extra dependency.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D152325
2023-06-06 19:12:51 -07:00
Ellis Hoag
1117b9a284 [InstrProf] Use BalancedPartitioning to order temporal profiling trace data
In [0] we described an algorithm called //BalancedPartitioning// (bp) to consume function traces [1] and compute a function order that reduces the number of page faults during startup.

This patch adds the `order` command to the `llvm-profdata` tool which uses bp to output a function order that can be passed to the linker via `--symbol-ordering-file=`.

Special thanks to Sergey Pupyrev and Julian Mestre for designing this balanced partitioning algorithm.

[0] https://discourse.llvm.org/t/rfc-temporal-profiling-extension-for-irpgo/68068
[1] https://reviews.llvm.org/D147287

Reviewed By: spupyrev

Differential Revision: https://reviews.llvm.org/D147812
2023-06-06 11:59:57 -07:00