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.