diff options
author | Sami Tolvanen <samitolvanen@google.com> | 2021-12-10 11:11:28 -0800 |
---|---|---|
committer | Sami Tolvanen <samitolvanen@google.com> | 2021-12-10 12:21:37 -0800 |
commit | 9a74c753fe3fb40afeb0660060538678dd77d060 (patch) | |
tree | ad57bca76ec7ccf0f575dd0c4097fed345443074 /llvm/lib/MC/MCStreamer.cpp | |
parent | b575405cc3a53112c487fd2dab2d3ed75c3944ab (diff) | |
download | llvm-9a74c753fe3fb40afeb0660060538678dd77d060.zip llvm-9a74c753fe3fb40afeb0660060538678dd77d060.tar.gz llvm-9a74c753fe3fb40afeb0660060538678dd77d060.tar.bz2 |
[ThinLTO][MC] Use conditional assignments for promotion aliases
Inline assembly refererences to static functions with ThinLTO+CFI were
fixed in D104058 by creating aliases for promoted functions. Creating
the aliases unconditionally resulted in an unexpected size increase in
a Chrome helper binary:
https://bugs.chromium.org/p/chromium/issues/detail?id=1261715
This is caused by the compiler being unable to drop unused code now
referenced by the alias in module-level inline assembly. This change
adds a .set_conditional assembly extension, which emits an assignment
only if the target symbol is also emitted, avoiding phantom references
to functions that could have otherwise been dropped.
This is an alternative to the solution proposed in D112761.
Reviewed By: pcc, nickdesaulniers, MaskRay
Differential Revision: https://reviews.llvm.org/D113613
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCStreamer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp index b056311..9c37a7b 100644 --- a/llvm/lib/MC/MCStreamer.cpp +++ b/llvm/lib/MC/MCStreamer.cpp @@ -431,6 +431,9 @@ void MCStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) { TS->emitLabel(Symbol); } +void MCStreamer::emitConditionalAssignment(MCSymbol *Symbol, + const MCExpr *Value) {} + void MCStreamer::emitCFISections(bool EH, bool Debug) {} void MCStreamer::emitCFIStartProc(bool IsSimple, SMLoc Loc) { |