[PATCH] D38517: Enabling new pass manager in LTO (and thinLTO) link step via -fexperimental-new-pass-manager option
    Sean Fertile via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Oct  4 18:52:41 PDT 2017
    
    
  
This revision was automatically updated to reflect the committed changes.
Closed by commit rL314964: Enabling new pass manager in LTO (and thinLTO) link step. (authored by sfertile).
Changed prior to commit:
  https://reviews.llvm.org/D38517?vs=117677&id=117771#toc
Repository:
  rL LLVM
https://reviews.llvm.org/D38517
Files:
  cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
  cfe/trunk/test/Driver/gold-lto-new-pass-man.c
Index: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
+++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
@@ -454,6 +454,14 @@
       CmdArgs.push_back(
           Args.MakeArgString(Twine("-plugin-opt=sample-profile=") + FName));
   }
+
+  // Need this flag to turn on new pass manager via Gold plugin.
+  if (Args.hasFlag(options::OPT_fexperimental_new_pass_manager,
+                   options::OPT_fno_experimental_new_pass_manager,
+                   /* Default */ false)) {
+    CmdArgs.push_back("-plugin-opt=new-pass-manager");
+  }
+
 }
 
 void tools::addArchSpecificRPath(const ToolChain &TC, const ArgList &Args,
Index: cfe/trunk/test/Driver/gold-lto-new-pass-man.c
===================================================================
--- cfe/trunk/test/Driver/gold-lto-new-pass-man.c
+++ cfe/trunk/test/Driver/gold-lto-new-pass-man.c
@@ -0,0 +1,7 @@
+// RUN: touch %t.o
+//
+// RUN: %clang -target ppc64le-unknown-linux -### %t.o -flto 2>&1 \
+// RUN:     -Wl,-plugin-opt=foo -O3 \
+// RUN:     -fexperimental-new-pass-manager \
+// RUN:     | FileCheck %s
+// CHECK: "-plugin-opt=new-pass-manager"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38517.117771.patch
Type: text/x-patch
Size: 1229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171005/7dd2b957/attachment.bin>
    
    
More information about the cfe-commits
mailing list