Revert "[PM/CC1] Add -f[no-]split-cold-code CC1 option to toggle splitting"
authorHans Wennborg <hans@chromium.org>
Mon, 19 Oct 2020 10:23:22 +0000 (12:23 +0200)
committerHans Wennborg <hans@chromium.org>
Mon, 19 Oct 2020 10:31:14 +0000 (12:31 +0200)
commit0628bea5137047232f37c94b74bf26aa9b55f605
treefea0f440c6c3e7b20d4575a0de32bc203153df41
parentd0f287464d8a2b6940cc968850b7a013c665981a
Revert "[PM/CC1] Add -f[no-]split-cold-code CC1 option to toggle splitting"

This broke Chromium's PGO build, it seems because hot-cold-splitting got turned
on unintentionally. See comment on the code review for repro etc.

> This patch adds -f[no-]split-cold-code CC1 options to clang. This allows
> the splitting pass to be toggled on/off. The current method of passing
> `-mllvm -hot-cold-split=true` to clang isn't ideal as it may not compose
> correctly (say, with `-O0` or `-Oz`).
>
> To implement the -fsplit-cold-code option, an attribute is applied to
> functions to indicate that they may be considered for splitting. This
> removes some complexity from the old/new PM pipeline builders, and
> behaves as expected when LTO is enabled.
>
> Co-authored by: Saleem Abdulrasool <compnerd@compnerd.org>
> Differential Revision: https://reviews.llvm.org/D57265
> Reviewed By: Aditya Kumar, Vedant Kumar
> Reviewers: Teresa Johnson, Aditya Kumar, Fedor Sergeev, Philip Pfaffe, Vedant Kumar

This reverts commit 273c299d5d649a0222fbde03c9a41e41913751b4.
69 files changed:
clang/include/clang/Basic/CodeGenOptions.def
clang/include/clang/Basic/DiagnosticFrontendKinds.td
clang/include/clang/Driver/Options.td
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/split-cold-code.c [deleted file]
clang/test/Frontend/split-cold-code.c [deleted file]
llvm/include/llvm/Transforms/IPO/HotColdSplitting.h
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Transforms/IPO/HotColdSplitting.cpp
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
llvm/test/CodeGen/AMDGPU/opt-pipeline.ll
llvm/test/Other/X86/lto-hot-cold-split.ll
llvm/test/Other/new-pm-defaults.ll
llvm/test/Other/new-pm-lto-defaults.ll
llvm/test/Other/new-pm-pgo.ll
llvm/test/Other/new-pm-thinlto-defaults.ll
llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
llvm/test/Other/opt-O2-pipeline.ll
llvm/test/Other/opt-O3-pipeline-enable-matrix.ll
llvm/test/Other/opt-O3-pipeline.ll
llvm/test/Other/opt-Os-pipeline.ll
llvm/test/Other/opt-hot-cold-split.ll
llvm/test/Other/pass-pipelines.ll
llvm/test/Transforms/CodeExtractor/extract-assume.ll
llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll
llvm/test/Transforms/HotColdSplit/addr-taken.ll
llvm/test/Transforms/HotColdSplit/apply-noreturn-bonus.ll
llvm/test/Transforms/HotColdSplit/apply-penalty-for-inputs.ll
llvm/test/Transforms/HotColdSplit/apply-penalty-for-outputs.ll
llvm/test/Transforms/HotColdSplit/apply-successor-penalty.ll
llvm/test/Transforms/HotColdSplit/assumption-cache-invalidation.ll
llvm/test/Transforms/HotColdSplit/coldentrycount.ll
llvm/test/Transforms/HotColdSplit/delete-use-without-def-dbg-val.ll
llvm/test/Transforms/HotColdSplit/duplicate-phi-preds-crash.ll
llvm/test/Transforms/HotColdSplit/eh-pads.ll
llvm/test/Transforms/HotColdSplit/eh-typeid-for.ll
llvm/test/Transforms/HotColdSplit/forward-dfs-reaches-marked-block.ll
llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-1.ll
llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-2.ll
llvm/test/Transforms/HotColdSplit/mark-the-whole-func-cold.ll
llvm/test/Transforms/HotColdSplit/minsize.ll
llvm/test/Transforms/HotColdSplit/multiple-exits.ll
llvm/test/Transforms/HotColdSplit/noreturn.ll
llvm/test/Transforms/HotColdSplit/outline-cold-asm.ll
llvm/test/Transforms/HotColdSplit/outline-disjoint-diamonds.ll
llvm/test/Transforms/HotColdSplit/outline-if-then-else.ll
llvm/test/Transforms/HotColdSplit/outline-multiple-entry-region.ll
llvm/test/Transforms/HotColdSplit/outline-while-loop.ll
llvm/test/Transforms/HotColdSplit/phi-with-distinct-outlined-values.ll
llvm/test/Transforms/HotColdSplit/region-overlap.ll
llvm/test/Transforms/HotColdSplit/resume.ll
llvm/test/Transforms/HotColdSplit/retain-section.ll
llvm/test/Transforms/HotColdSplit/section-splitting-custom.ll
llvm/test/Transforms/HotColdSplit/section-splitting-default.ll
llvm/test/Transforms/HotColdSplit/split-cold-2.ll
llvm/test/Transforms/HotColdSplit/split-out-dbg-label.ll
llvm/test/Transforms/HotColdSplit/split-out-dbg-val-of-arg.ll
llvm/test/Transforms/HotColdSplit/split-phis-in-exit-blocks.ll
llvm/test/Transforms/HotColdSplit/stale-assume-in-original-func.ll
llvm/test/Transforms/HotColdSplit/succ-block-with-self-edge.ll
llvm/test/Transforms/HotColdSplit/swifterror.ll
llvm/test/Transforms/HotColdSplit/transfer-debug-info.ll
llvm/test/Transforms/HotColdSplit/unwind.ll
llvm/test/Transforms/HotColdSplit/update-split-loop-metadata.ll
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/generated_funcs.ll
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/generated_funcs.ll.generated.expected
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/generated_funcs.ll.nogenerated.expected