This is an archive of the discontinued LLVM Phabricator instance.

"Reland "[pgo] Avoid introducing relocations by using private alias"
AbandonedPublic

Authored by paulkirth on Jan 9 2023, 1:16 PM.

Details

Reviewers
None
Summary

In many cases, we can use an alias to avoid a symbolic relocations,
instead of using the public, interposable symbol. When the instrumented
function is in a COMDAT, we can use a hidden alias, and still avoid
references to discarded sections.

Previous versions of this patch allowed the compiler to name the
generated alias, but that would only be valid when the functions were
local. Since the alias may be used across TUs we use a more
deterministic naming convention, and add a .local suffix to the alias
name just as we do for relative vtables aliases.

This should be safe to land after an incorrect LLD assertion was removed
in https://reviews.llvm.org/rG20894a478da224bdd69c91a22a5175b28bc08ed9
which caused assertion failures in LLD on Mac.

Diff Detail

Event Timeline

paulkirth created this revision.Jan 9 2023, 1:16 PM
paulkirth requested review of this revision.Jan 9 2023, 1:16 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 9 2023, 1:16 PM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
paulkirth abandoned this revision.Jan 9 2023, 1:17 PM

Missed readding the original review tag for a reland.