[PATCH] D57265: [PM/CC1] Add -f[no-]split-cold-code CC1 options to toggle splitting
Nick Desaulniers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 19 11:03:36 PDT 2020
nickdesaulniers added a comment.
It looks like this caused breakage for us for x86 Linux kernels, too: https://github.com/ClangBuiltLinux/linux/issues/1177. The Linux kernel does not and will not link against libgcc_s/compiler-rt, so optimizations at `-Oz` tend to both produce libcalls that aren't implemented by the kernel's runtime, and larger code than `-Os` (see https://bugs.llvm.org/show_bug.cgi?id=47897 which was also filed in response to this patch's resulting bug). It appears with this patch applied, that any function marked `__attribute__((cold))` (explicitly or due to AutoFDO profiles) would be optimized at `-Oz`, regardless of optimization level. (I think that approach is ok, but I would prefer `-Os` if possible to avoid the excessive code bloat that `-Oz` produces and avoid the libcalls; we have found `-Oz` to never be smaller than `-Os` for kernel builds).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57265/new/
https://reviews.llvm.org/D57265
More information about the cfe-commits
mailing list