diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -107,7 +107,10 @@ Removed Compiler Flags ------------------------- -- ... +- ``-fno-experimental-new-pass-manager`` has been removed. + ``-flegacy-pass-manager`` can be used as a makeshift, + Using the legacy pass manager for the optimization pipeline was deprecated in + 13.0.0 and will be removed after 14.0.0. New Pragmas in Clang -------------------- diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1906,7 +1906,7 @@ def fexperimental_new_pass_manager : Flag<["-"], "fexperimental-new-pass-manager">, Group, Flags<[CC1Option]>, Alias; def fno_experimental_new_pass_manager : Flag<["-"], "fno-experimental-new-pass-manager">, - Group, Flags<[CC1Option]>, Alias; + Group, Flags<[CC1Option,NoDriverOption]>, Alias; def fexperimental_strict_floating_point : Flag<["-"], "fexperimental-strict-floating-point">, Group, Flags<[CC1Option]>, HelpText<"Enables experimental strict floating point in LLVM.">, diff --git a/clang/test/Driver/flegacy-pass-manager.c b/clang/test/Driver/flegacy-pass-manager.c --- a/clang/test/Driver/flegacy-pass-manager.c +++ b/clang/test/Driver/flegacy-pass-manager.c @@ -1,9 +1,9 @@ // RUN: %clang -### -c -flegacy-pass-manager -fno-legacy-pass-manager %s 2>&1 | FileCheck --check-prefixes=NOWARN,NEW %s // RUN: %clang -### -c -fno-legacy-pass-manager -flegacy-pass-manager %s 2>&1 | FileCheck --check-prefixes=NOWARN,LEGACY %s -/// -f[no-]experimental-new-pass-manager are legacy aliases when the new PM was still experimental. -// RUN: %clang -### -c -fno-experimental-new-pass-manager -fexperimental-new-pass-manager %s 2>&1 | FileCheck --check-prefixes=NOWARN,NEW %s -// RUN: %clang -### -c -fexperimental-new-pass-manager -fno-experimental-new-pass-manager %s 2>&1 | FileCheck --check-prefixes=NOWARN,LEGACY %s +/// -fexperimental-new-pass-manager is a legacy alias. -fno-experimental-new-pass-manager has been removed. +// RUN: %clang -### -c -fexperimental-new-pass-manager %s 2>&1 | FileCheck --check-prefixes=NOWARN,NEW %s +// RUN: not %clang -### -fno-experimental-new-pass-manager %s // NOWARN-NOT: warning: argument unused @@ -20,7 +20,6 @@ // LTO_NEW: "-plugin-opt=new-pass-manager" // RUN: %clang -### -target x86_64-linux -flto -flegacy-pass-manager %s 2>&1 | FileCheck --check-prefix=LTO_LEGACY %s -// RUN: %clang -### -target x86_64-linux -flto=thin -fno-experimental-new-pass-manager %s 2>&1 | FileCheck --check-prefix=LTO_LEGACY %s // LTO_LEGACY: "-plugin-opt=legacy-pass-manager" diff --git a/clang/test/Frontend/optimization-remark-with-hotness.c b/clang/test/Frontend/optimization-remark-with-hotness.c deleted file mode 100644 --- a/clang/test/Frontend/optimization-remark-with-hotness.c +++ /dev/null @@ -1,78 +0,0 @@ -// Generate instrumentation and sampling profile data. -// RUN: llvm-profdata merge \ -// RUN: %S/Inputs/optimization-remark-with-hotness.proftext \ -// RUN: -o %t.profdata -// RUN: llvm-profdata merge -sample \ -// RUN: %S/Inputs/optimization-remark-with-hotness-sample.proftext \ -// RUN: -o %t-sample.profdata -// -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ -// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ -// RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \ -// RUN: -fno-experimental-new-pass-manager \ -// RUN: -Rpass-analysis=inline -Rpass-missed=inline \ -// RUN: -fdiagnostics-show-hotness -verify -// The clang version of the previous test. -// RUN: %clang -target x86_64-apple-macosx10.9 %s -c -emit-llvm -o /dev/null \ -// RUN: -fprofile-instr-use=%t.profdata -Rpass=inline \ -// RUN: -fno-experimental-new-pass-manager \ -// RUN: -Rpass-analysis=inline -Rpass-missed=inline \ -// RUN: -fdiagnostics-show-hotness -Xclang -verify -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ -// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ -// RUN: -fprofile-sample-use=%t-sample.profdata -Rpass=inline \ -// RUN: -fno-experimental-new-pass-manager \ -// RUN: -Rpass-analysis=inline -Rpass-missed=inline \ -// RUN: -fdiagnostics-show-hotness -fdiagnostics-hotness-threshold=10 \ -// RUN: -verify -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ -// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ -// RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \ -// RUN: -fno-experimental-new-pass-manager \ -// RUN: -Rpass-analysis=inline -Rpass-missed=inline \ -// RUN: -fdiagnostics-show-hotness -fdiagnostics-hotness-threshold=10 -verify -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ -// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ -// RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \ -// RUN: -fno-experimental-new-pass-manager \ -// RUN: -Rpass-analysis=inline 2>&1 | FileCheck -check-prefix=HOTNESS_OFF %s -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ -// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ -// RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \ -// RUN: -fno-experimental-new-pass-manager \ -// RUN: -Rpass-analysis=inline -Rno-pass-with-hotness 2>&1 | FileCheck \ -// RUN: -check-prefix=HOTNESS_OFF %s -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ -// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ -// RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \ -// RUN: -Rpass-analysis=inline -fdiagnostics-show-hotness \ -// RUN: -fdiagnostics-hotness-threshold=100 2>&1 \ -// RUN: | FileCheck -allow-empty -check-prefix=THRESHOLD %s -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ -// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ -// RUN: -Rpass=inline -Rpass-analysis=inline \ -// RUN: -fdiagnostics-show-hotness -fdiagnostics-hotness-threshold=10 2>&1 \ -// RUN: | FileCheck -check-prefix=NO_PGO %s - -int foo(int x, int y) __attribute__((always_inline)); -int foo(int x, int y) { return x + y; } - -int sum = 0; - -void bar(int x) { - // HOTNESS_OFF: 'foo' inlined into 'bar' - // HOTNESS_OFF-NOT: hotness: - // THRESHOLD-NOT: inlined - // THRESHOLD-NOT: hotness - // NO_PGO: '-fdiagnostics-show-hotness' requires profile-guided optimization information - // NO_PGO: '-fdiagnostics-hotness-threshold=' requires profile-guided optimization information - // expected-remark@+1 {{'foo' inlined into 'bar' with (cost=always): always inliner at callsite bar:8:10; (hotness:}} - sum += foo(x, x - 2); -} - -int main(int argc, const char *argv[]) { - for (int i = 0; i < 30; i++) - // expected-remark@+1 {{'bar' not inlined into 'main' because it should never be inlined (cost=never): no alwaysinline attribute (hotness:}} - bar(argc); - return sum; -}