llvm.org GIT mirror llvm / 65834ee
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329249 91177308-0d34-0410-b5e6-96231b3b80d8 Teresa Johnson 2 years ago
2 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; Test plugin options new-pass-manager and debug-pass-manager
1 ; RUN: opt -module-summary %s -o %t.o
2
3 ; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
4 ; RUN: --plugin-opt=thinlto \
5 ; RUN: --plugin-opt=new-pass-manager \
6 ; RUN: --plugin-opt=debug-pass-manager \
7 ; RUN: --plugin-opt=cache-dir=%t.cache \
8 ; RUN: -o %t2.o %t.o 2>&1 | FileCheck %s
9
10 ; CHECK: Starting llvm::Module pass manager run
11
12 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
13 target triple = "x86_64-unknown-linux-gnu"
14
15 define void @globalfunc() #0 {
16 entry:
17 ret void
18 }
196196 static std::string sample_profile;
197197 // New pass manager
198198 static bool new_pass_manager = false;
199 // Debug new pass manager
200 static bool debug_pass_manager = false;
199201
200202 static void process_plugin_option(const char *opt_)
201203 {
257259 sample_profile= opt.substr(strlen("sample-profile="));
258260 } else if (opt == "new-pass-manager") {
259261 new_pass_manager = true;
262 } else if (opt == "debug-pass-manager") {
263 debug_pass_manager = true;
260264 } else {
261265 // Save this option to pass to the code generator.
262266 // ParseCommandLineOptions() expects argv[0] to be program name. Lazily
852856
853857 // Use new pass manager if set in driver
854858 Conf.UseNewPM = options::new_pass_manager;
859 // Debug new pass manager if requested
860 Conf.DebugPassManager = options::debug_pass_manager;
855861
856862 return llvm::make_unique(std::move(Conf), Backend,
857863 options::ParallelCodeGenParallelismLevel);