This is an archive of the discontinued LLVM Phabricator instance.

WIP: [CodeGen] Disable aggressive structor optimizations at -O0, take 4
AbandonedPublic

Authored by labath on Jul 30 2018, 8:02 AM.

Details

Reviewers
None
Summary

This version of the patch attempts to mitigate the code size regressions
caused by the previous versions of this patch (D46685). It does this by
using aliases and C5/D5 comdats more aggressively.

This is not completely trivial, as linkonce_odr structors (these are
othe ones that were previously causing the blowup) are emitte lazily,
only when they are referenced, but we are only able to use the comdat if
all of the elements that should go into it are emitted. This is
particularly tricky for virtual desctructors as here the comdat must
include all three versions (complete, base, deleting).

As we do not (?) want this to impact the decisions on whether to emit
certain variants or not (and the full set of emitted versions is not
easily accessible from the place where we make the comdat decision), we
have to opportunistically wait for all required versions to be emitted.
If they are, we coalesce them into a comdat.

Diff Detail

Event Timeline

labath created this revision.Jul 30 2018, 8:02 AM
labath abandoned this revision.Nov 26 2019, 6:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 26 2019, 6:45 AM