This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Add option to disable -mconstructor-aliases with -mno-constructor-aliases
ClosedPublic

Authored by modimo on Nov 17 2021, 5:32 PM.

Details

Summary

We've found that when profiling, counts are only generated for the real definition of constructor aliases (C2 in mangled name). However, when compiling the C1 version is present at the callsite and leads to a lack of counts due to this aliasing. This causes us to miss out on inlining an otherwise hot constructor.

-mconstructor-aliases is AFAICT an optimization, so having a disabling flag if wanted seems valuable.

Testing:
ninja check-all

Diff Detail

Event Timeline

modimo created this revision.Nov 17 2021, 5:32 PM
modimo requested review of this revision.Nov 17 2021, 5:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2021, 5:32 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
modimo edited the summary of this revision. (Show Details)Nov 17 2021, 5:40 PM
modimo added reviewers: bruno, dblaikie, dang.
wenlei added inline comments.Nov 17 2021, 10:01 PM
clang/include/clang/Driver/Options.td
5069–5072

nit: use two lines for consistency. check sanitize_stats, sanitize_cfi_cross_dso and others.

modimo updated this revision to Diff 388307.Nov 18 2021, 1:26 PM

Condense lines

wenlei accepted this revision.Nov 18 2021, 1:45 PM

lgtm, thanks

This revision is now accepted and ready to land.Nov 18 2021, 1:45 PM