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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits