[all-commits] [llvm/llvm-project] 131fd5: [CFI][ThinLTO] Remove the need for CFI calculating...
Mircea Trofin via All-commits
all-commits at lists.llvm.org
Thu Jun 4 21:17:12 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 131fd59a0296383bc9fec9bb0459201814bc3d0c
https://github.com/llvm/llvm-project/commit/131fd59a0296383bc9fec9bb0459201814bc3d0c
Author: Mircea Trofin <mtrofin at google.com>
Date: 2026-06-04 (Thu, 04 Jun 2026)
Changed paths:
M llvm/include/llvm/IR/AutoUpgrade.h
M llvm/include/llvm/IR/ModuleSummaryIndex.h
M llvm/lib/AsmParser/LLParser.cpp
M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
M llvm/lib/IR/AutoUpgrade.cpp
M llvm/lib/Transforms/IPO/CrossDSOCFI.cpp
M llvm/lib/Transforms/IPO/LowerTypeTests.cpp
M llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
A llvm/test/Bitcode/Inputs/cfi-functions-upgrade.bc
A llvm/test/Bitcode/Inputs/cfi-summary-upgrade.bc
A llvm/test/Bitcode/cfi-functions-upgrade.ll
M llvm/test/Bitcode/summary_version.ll
M llvm/test/ThinLTO/X86/cfi-icall-only-defuse.ll
A llvm/test/ThinLTO/X86/cfi-icall-thinlto.ll
M llvm/test/ThinLTO/X86/cfi-icall.ll
M llvm/test/Transforms/CrossDSOCFI/cfi_functions.ll
M llvm/test/Transforms/LowerTypeTests/export-alias.ll
M llvm/test/Transforms/LowerTypeTests/export-cross-dso-cfi.ll
M llvm/test/Transforms/LowerTypeTests/export-icall.ll
M llvm/test/Transforms/LowerTypeTests/export-rename-local.ll
M llvm/test/Transforms/LowerTypeTests/export-symver.ll
M llvm/test/Transforms/LowerTypeTests/pr37625.ll
M llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll
Log Message:
-----------
[CFI][ThinLTO] Remove the need for CFI calculating ThinLTO GUIDs (#201370)
CFI does name-based matching. ThinLTO uses a hash over the function name
(the "GUID"). As a result of this
[RFC](https://discourse.llvm.org/t/rfc-keep-globalvalue-guids-stable/84801)
- see also PR #184065 - GUID calculation should be treated as an
implementation detail, i.e. passes shouldn't need to re-do / reverse
engineer GUIDs.
The main reasons CFI is aware of GUIDs is because (1) the CFI functions
need to be communicated to ThinLink, as they need to be treated as
exports, in `LTO::runThinLTO`; and (2) because CFI needs to check the
liveliness of functions referenced in `cfi.functions` metadata, and this
check happens via the thinlto export summary
(`LowerTypeTestsModule::lower`).
To a lesser extent, the optimization in PR #130382 benefits from CFI
knowing about GUIDs; however, if this were the only reason, we could
make `ValueInfo`s available at that point, which carry names, and
perform name-based matching for CFI's needs.
This PR lets GUIDs be passed to CFI. The bulk of the change is moving
them around as metadata fields. The GUID calculation is hoisted out, but
kept the same as before this patch, following that once PR #184065 is
relanded it will be switched to the stable mechanism it (PR #184065)
introduces. The compile time effects are
[here](https://llvm-compile-time-tracker.com/compare.php?from=b29bf9fa25bdb906a61ec361fba68796020cc6b9&to=7bb1c07144e8ccb8a3332e91fc193303acd9439e&stat=instructions:u).
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