You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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).
0 commit comments