[PATCH] D123609: [Clang] Remove support for legacy pass manager

2023-01-03 Thread Sam Elliott via Phabricator via cfe-commits
lenary added a comment.
Herald added a subscriber: pcwang-thead.

In D123609#3451334 , @nikic wrote:

> In D123609#3451320 , @HaohaiWen 
> wrote:
>
>> Hi @nikic,
>> We recently noticed legacy PM was removed from many places.
>> Does community plan to remove legacy PM completely?
>> Do you know when will CG switch to new PM?
>> Thanks.
>
> At this time, the ability to run a middle-end optimization pipeline using the 
> legacy pass manager (basically anything based on PassManagerBuilder) is being 
> removed. The CodeGen pipeline continues to use the legacy pass manager at 
> this time -- I'm not aware of anyone doing active migration work in that area.

Sorry to resurrect an old patch, but can you please update the docs here 
https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers
 with this info?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123609/new/

https://reviews.llvm.org/D123609

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123609: [Clang] Remove support for legacy pass manager

2022-04-14 Thread Nikita Popov via Phabricator via cfe-commits
nikic added a comment.

In D123609#3451320 , @HaohaiWen wrote:

> Hi @nikic,
> We recently noticed legacy PM was removed from many places.
> Does community plan to remove legacy PM completely?
> Do you know when will CG switch to new PM?
> Thanks.

At this time, the ability to run a middle-end optimization pipeline using the 
legacy pass manager (basically anything based on PassManagerBuilder) is being 
removed. The CodeGen pipeline continues to use the legacy pass manager at this 
time -- I'm not aware of anyone doing active migration work in that area.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123609/new/

https://reviews.llvm.org/D123609

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123609: [Clang] Remove support for legacy pass manager

2022-04-14 Thread Haohai, Wen via Phabricator via cfe-commits
HaohaiWen added a comment.

Hi @nikic,
We recently noticed legacy PM was removed from many places.
Does community plan to remove legacy PM completely?
Do you know when will CG switch to new PM?
Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123609/new/

https://reviews.llvm.org/D123609

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123609: [Clang] Remove support for legacy pass manager

2022-04-13 Thread Nikita Popov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2978d026819b: [Clang] Remove support for legacy pass manager 
(authored by nikic).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D123609?vs=45=422427#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123609/new/

https://reviews.llvm.org/D123609

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/Driver/flegacy-pass-manager.c

Index: clang/test/Driver/flegacy-pass-manager.c
===
--- clang/test/Driver/flegacy-pass-manager.c
+++ clang/test/Driver/flegacy-pass-manager.c
@@ -1,29 +1,13 @@
-// 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
+/// -fno-legacy-pass-manager and -fexperimental-new-pass-manager are retained
+// as no-ops. The inverted options are no longer supported.
 
-/// -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
-
-// NEW:-fno-legacy-pass-manager
-// NEW-NOT:-flegacy-pass-manager
-
-// LEGACY: -flegacy-pass-manager
-// LEGACY-NOT: -fno-legacy-pass-manager
+// RUN: %clang -### -c -fno-legacy-pass-manager %s 2>&1 | FileCheck %s
+// RUN: not %clang -### -flegacy-pass-manager %s
 
-/// For full/Thin LTO, -fno-legacy-pass-manager passes -plugin-opt=new-pass-manager to the linker (which may not be LLD).
-// RUN: %clang -### -target x86_64-linux -flto -fno-legacy-pass-manager %s 2>&1 | FileCheck --check-prefix=LTO_NEW %s
-// RUN: %clang -### -target x86_64-linux -flto=thin -fexperimental-new-pass-manager %s 2>&1 | FileCheck --check-prefix=LTO_NEW %s
-
-// 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 -### -c -fexperimental-new-pass-manager %s 2>&1 | FileCheck %s
+// RUN: not %clang -### -fno-experimental-new-pass-manager %s
 
-// LTO_LEGACY: "-plugin-opt=legacy-pass-manager"
+// Just check that there is no argument unused warning. There is no need to
+// pass any cc1 options.
 
-// RUN: %clang -### -target x86_64-linux -flto %s 2>&1 | FileCheck --check-prefix=DEFAULT %s
-//
-// DEFAULT-NOT: "-plugin-opt=new-pass-manager"
-// DEFAULT-NOT: "-plugin-opt=legacy-pass-manager"
+// CHECK-NOT: warning: argument unused
Index: clang/lib/Frontend/CompilerInvocation.cpp
===
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -543,11 +543,6 @@
   << A->getSpelling() << T.getTriple();
   }
 
-  if (!CodeGenOpts.ProfileRemappingFile.empty() && CodeGenOpts.LegacyPassManager)
-Diags.Report(diag::err_drv_argument_only_allowed_with)
-<< Args.getLastArg(OPT_fprofile_remapping_file_EQ)->getAsString(Args)
-<< "-fno-legacy-pass-manager";
-
   return Diags.getNumErrors() == NumErrorsBefore;
 }
 
@@ -1731,10 +1726,6 @@
 
 // -ftime-report= is only for new pass manager.
 if (A->getOption().getID() == OPT_ftime_report_EQ) {
-  if (Opts.LegacyPassManager)
-Diags.Report(diag::err_drv_argument_only_allowed_with)
-<< A->getAsString(Args) << "-fno-legacy-pass-manager";
-
   StringRef Val = A->getValue();
   if (Val == "per-pass")
 Opts.TimePassesPerRun = false;
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -626,15 +626,6 @@
  Path));
   }
 
-  // Pass an option to enable/disable the new pass manager.
-  if (auto *A = Args.getLastArg(options::OPT_flegacy_pass_manager,
-options::OPT_fno_legacy_pass_manager)) {
-if (A->getOption().matches(options::OPT_flegacy_pass_manager))
-  CmdArgs.push_back("-plugin-opt=legacy-pass-manager");
-else
-  CmdArgs.push_back("-plugin-opt=new-pass-manager");
-  }
-
   // Setup statistics file output.
   SmallString<128> StatsFile = getStatsFileName(Args, Output, Input, D);
   if (!StatsFile.empty())
Index: