[PATCH] D57265: [PM/CC1] Add -f[no-]split-cold-code CC1 options to toggle splitting

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 25 16:30:13 PST 2019


vsk created this revision.
vsk added reviewers: chandlerc, t.p.northover, tejohnson, hiraditya.
Herald added a subscriber: mehdi_amini.

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.

I've held off on adding a driver option because the ultimate goal is to
remove these options, and to simply have the pass enabled by default.


https://reviews.llvm.org/D57265

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/CC1Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/split-cold-code.c
  llvm/include/llvm/Passes/PassBuilder.h
  llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57265.183597.patch
Type: text/x-patch
Size: 10230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190126/1dbd45c4/attachment-0001.bin>


More information about the cfe-commits mailing list