[llvm] r329249 - [gold] Add debug-pass-manager option, and use it to test new-pass-manager

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 20:16:58 PDT 2018


Author: tejohnson
Date: Wed Apr  4 20:16:57 2018
New Revision: 329249

URL: http://llvm.org/viewvc/llvm-project?rev=329249&view=rev
Log:
[gold] Add debug-pass-manager option, and use it to test new-pass-manager

Summary: Follow up from r314963.

Reviewers: pcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D45293

Added:
    llvm/trunk/test/tools/gold/X86/new-pm.ll
Modified:
    llvm/trunk/tools/gold/gold-plugin.cpp

Added: llvm/trunk/test/tools/gold/X86/new-pm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/new-pm.ll?rev=329249&view=auto
==============================================================================
--- llvm/trunk/test/tools/gold/X86/new-pm.ll (added)
+++ llvm/trunk/test/tools/gold/X86/new-pm.ll Wed Apr  4 20:16:57 2018
@@ -0,0 +1,19 @@
+; Test plugin options new-pass-manager and debug-pass-manager
+; RUN: opt -module-summary %s -o %t.o
+
+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
+; RUN:     --plugin-opt=thinlto \
+; RUN:     --plugin-opt=new-pass-manager \
+; RUN:     --plugin-opt=debug-pass-manager \
+; RUN:     --plugin-opt=cache-dir=%t.cache \
+; RUN:     -o %t2.o %t.o 2>&1 | FileCheck %s
+
+; CHECK: Starting llvm::Module pass manager run
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @globalfunc() #0 {
+entry:
+  ret void
+}

Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=329249&r1=329248&r2=329249&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Wed Apr  4 20:16:57 2018
@@ -197,6 +197,8 @@ namespace options {
   static std::string sample_profile;
   // New pass manager
   static bool new_pass_manager = false;
+  // Debug new pass manager
+  static bool debug_pass_manager = false;
 
   static void process_plugin_option(const char *opt_)
   {
@@ -258,6 +260,8 @@ namespace options {
       sample_profile= opt.substr(strlen("sample-profile="));
     } else if (opt == "new-pass-manager") {
       new_pass_manager = true;
+    } else if (opt == "debug-pass-manager") {
+      debug_pass_manager = true;
     } else {
       // Save this option to pass to the code generator.
       // ParseCommandLineOptions() expects argv[0] to be program name. Lazily
@@ -853,6 +857,8 @@ static std::unique_ptr<LTO> createLTO(In
 
   // Use new pass manager if set in driver
   Conf.UseNewPM = options::new_pass_manager;
+  // Debug new pass manager if requested
+  Conf.DebugPassManager = options::debug_pass_manager;
 
   return llvm::make_unique<LTO>(std::move(Conf), Backend,
                                 options::ParallelCodeGenParallelismLevel);




More information about the llvm-commits mailing list