This is an archive of the discontinued LLVM Phabricator instance.

Add `-f[no-]split-cold-code` toggling outlining & enable in -O
AbandonedPublic

Authored by compnerd on Oct 8 2020, 4:21 PM.

Details

Reviewers
vsk
rnk
Summary

In order for the hot/cold splitting pass to graduate out of
experimental status, users need some way to safely enable it.

The current method of passing -mllvm -hot-cold-split=true to clang is
not safe, because directly setting a cl::opt cannot interact well with
other CC1 options (e.g. -O0, or -disable-llvm-passes).

This patch adds -f[no-]split-cold-code CC1 options to clang so that the
splitting pass can be toggled/combined with other options without issue.
This makes it possible to deploy the new pass on a large scale.

Patch by Vedant Kumar <vsk@apple.com>!

This is extracted from the patches from the Swift contributed changes to
LLVM at https://github.com/llvm/llvm-project-staging/.

The few test changes here are to allow the tests to continue working
unperturbed.

This has been shipping with the Apple toolchain and has been tested.
The known deficiencies of the outlining here are the incorrect handling
for Windows EH unwind pads which are sometimes duplicately outlined
incorrectly.

Diff Detail

Event Timeline

compnerd created this revision.Oct 8 2020, 4:21 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 8 2020, 4:21 PM
compnerd requested review of this revision.Oct 8 2020, 4:21 PM
vsk added a comment.Oct 12 2020, 5:17 PM

@compnerd thank you for working on upstreaming this patch! Would you be open to commandeering D57265 instead? This is my (unfortunately stalled) attempt to upstream the same patch, and it has some review concerns from Fedor Sergeev, Philip Pfaffe, and others addressed.

compnerd abandoned this revision.Oct 13 2020, 11:10 AM

Sure, I think I can do that instead. Thanks for pointing me to that!