[all-commits] [llvm/llvm-project] 2383af: [NFC][ThinLTOBitcodeWriter] Add test for cfi.funct...
Vitaly Buka via All-commits
all-commits at lists.llvm.org
Tue Sep 15 15:57:33 PDT 2026
Branch: refs/heads/users/vitalybuka/spr/lowertypetests-reorder-cfi-jump-table-entries-based-on-hotness
Home: https://github.com/llvm/llvm-project
Commit: 2383af598759eb1d48ec51cf13f0ff39d058e668
https://github.com/llvm/llvm-project/commit/2383af598759eb1d48ec51cf13f0ff39d058e668
Author: Vitaly Buka <vitalybuka at google.com>
Date: 2026-09-15 (Tue, 15 Sep 2026)
Changed paths:
A llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-functions-hotness.ll
Log Message:
-----------
[NFC][ThinLTOBitcodeWriter] Add test for cfi.functions metadata hotness encoding
Add pre-commit test coverage establishing the baseline cfi.functions
metadata linkage operand values before implementing hotness encoding.
PR Stack:
* https://github.com/llvm/llvm-project/pull/220776
* https://github.com/llvm/llvm-project/pull/221043
* https://github.com/llvm/llvm-project/pull/221044
* ➤ https://github.com/llvm/llvm-project/pull/223843
* https://github.com/llvm/llvm-project/pull/223846
* https://github.com/llvm/llvm-project/pull/223848
* https://github.com/llvm/llvm-project/pull/221046
Assisted-by: Gemini
Pull Request: https://github.com/llvm/llvm-project/pull/223843
Commit: 3cf3f471884406da849a9defbcb65782c25f51c1
https://github.com/llvm/llvm-project/commit/3cf3f471884406da849a9defbcb65782c25f51c1
Author: Vitaly Buka <vitalybuka at google.com>
Date: 2026-09-15 (Tue, 15 Sep 2026)
Changed paths:
M llvm/include/llvm/Transforms/IPO/LowerTypeTests.h
M llvm/lib/Transforms/IPO/LowerTypeTests.cpp
M llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
M llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-functions-hotness.ll
Log Message:
-----------
[ThinLTOBitcodeWriter] Encode hotness into cfi.functions metadata
Encode basic block / entry profile count into the upper 6 bits of
the linkage operand in cfi.functions metadata. This allows LowerTypeTests
to order jump table entries by function hotness.
We only have 6 bits available in the linkage operand. Using a log2
compression loses precision, but it is sufficient for our application
because we only need a rough magnitude ordering to push the singularly
hottest target function to the end of the jump table; exact counts are
unnecessary.
PR Stack:
* https://github.com/llvm/llvm-project/pull/220776
* https://github.com/llvm/llvm-project/pull/221043
* https://github.com/llvm/llvm-project/pull/221044
* https://github.com/llvm/llvm-project/pull/223843
* ➤ https://github.com/llvm/llvm-project/pull/223846
* https://github.com/llvm/llvm-project/pull/223848
* https://github.com/llvm/llvm-project/pull/221046
Assisted-by: Gemini
Pull Request: https://github.com/llvm/llvm-project/pull/223846
Commit: ee9d096327f3da6b4196c6c57ae76e4526679303
https://github.com/llvm/llvm-project/commit/ee9d096327f3da6b4196c6c57ae76e4526679303
Author: Vitaly Buka <vitalybuka at google.com>
Date: 2026-09-15 (Tue, 15 Sep 2026)
Changed paths:
M llvm/test/Transforms/LowerTypeTests/cfi-jumptable-hotness-summary.ll
M llvm/test/Transforms/LowerTypeTests/cfi-jumptable-hotness.ll
Log Message:
-----------
[NFC][LowerTypeTests] Expand tests for CFI jump table hotness ordering
Expand pre-commit test coverage to establish the baseline CFI jump table
layout before implementing hotness-based reordering in
https://github.com/llvm/llvm-project/pull/221046.
We expand these tests to verify we accurately track hotness data
originating from `cfi.functions` metadata, BlockFrequencyInfo (BFI)
counts, and IR function attributes (hot/cold). By covering these inputs,
we ensure the correct hotness tier is propagated for layout decisions
across different profile sources and LTO targets.
These tests verify the baseline declaration-order layout where functions
within each strict type are placed without hotness consideration, making
the subsequent reordering diff explicit and easy to review.
PR Stack:
* https://github.com/llvm/llvm-project/pull/220776
* https://github.com/llvm/llvm-project/pull/221043
* https://github.com/llvm/llvm-project/pull/221044
* https://github.com/llvm/llvm-project/pull/223843
* https://github.com/llvm/llvm-project/pull/223846
* ➤ https://github.com/llvm/llvm-project/pull/223848
* https://github.com/llvm/llvm-project/pull/221046
Assisted-by: Gemini
Pull Request: https://github.com/llvm/llvm-project/pull/223848
Commit: 2de0c11ea1a5de77ef8b449aaab29a6be42b8a25
https://github.com/llvm/llvm-project/commit/2de0c11ea1a5de77ef8b449aaab29a6be42b8a25
Author: Vitaly Buka <vitalybuka at google.com>
Date: 2026-09-15 (Tue, 15 Sep 2026)
Changed paths:
M llvm/lib/Transforms/IPO/LowerTypeTests.cpp
M llvm/test/Transforms/LowerTypeTests/cfi-jumptable-hotness-summary.ll
M llvm/test/Transforms/LowerTypeTests/cfi-jumptable-hotness.ll
Log Message:
-----------
[LowerTypeTests] Reorder CFI jump table entries based on hotness
Order CFI jump table entries by function hotness. We use `cfi.functions`
metadata in ThinLTO, or `BlockFrequencyInfo` / function entry counts in
full LTO.
We want the hottest function to be optimized by the last entry thing for
SHT_LLVM_CFI_JUMP_TABLE. The linker deletes the final branch in the jump
table and moves the table directly before that target function so it
falls through.
This also ensures the jump table lands in a hot section (.text.hot)
instead of a cold section (.text.unlikely). Type contiguity is
preserved.
This PR reliably improves the performance of our server binary by 0.2%,
and some smaller binaries up to 5%.
PR Stack:
* https://github.com/llvm/llvm-project/pull/220776
* https://github.com/llvm/llvm-project/pull/221043
* https://github.com/llvm/llvm-project/pull/221044
* https://github.com/llvm/llvm-project/pull/223843
* https://github.com/llvm/llvm-project/pull/223846
* https://github.com/llvm/llvm-project/pull/223848
* ➤ https://github.com/llvm/llvm-project/pull/221046
Assisted-by: Gemini
Pull Request: https://github.com/llvm/llvm-project/pull/221046
Compare: https://github.com/llvm/llvm-project/compare/e0c3c27b44b7...2de0c11ea1a5
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