summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Basic/CodeGenOptions.h4
-rw-r--r--clang/include/clang/Driver/CC1Options.td2
-rw-r--r--clang/include/clang/Driver/Options.td4
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp1
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp7
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp8
-rw-r--r--clang/lib/Driver/ToolChains/Darwin.cpp8
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp5
-rw-r--r--clang/test/CodeGen/opt-record-MIR.c11
-rw-r--r--clang/test/CodeGen/opt-record.c5
-rw-r--r--clang/test/Driver/darwin-ld.c4
-rw-r--r--clang/test/Driver/opt-record.c9
-rw-r--r--lld/ELF/Config.h1
-rw-r--r--lld/ELF/Driver.cpp1
-rw-r--r--lld/ELF/LTO.cpp1
-rw-r--r--lld/ELF/Options.td2
-rw-r--r--lld/docs/ld.lld.13
-rw-r--r--lld/test/ELF/lto/opt-remarks.ll5
-rw-r--r--llvm/include/llvm/IR/RemarkStreamer.h7
-rw-r--r--llvm/include/llvm/LTO/Config.h3
-rw-r--r--llvm/include/llvm/LTO/LTO.h1
-rw-r--r--llvm/lib/IR/RemarkStreamer.cpp14
-rw-r--r--llvm/lib/LTO/LTO.cpp6
-rw-r--r--llvm/lib/LTO/LTOBackend.cpp8
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp8
-rw-r--r--llvm/lib/LTO/ThinLTOCodeGenerator.cpp4
-rw-r--r--llvm/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll2
-rw-r--r--llvm/test/ThinLTO/X86/diagnostic-handler-remarks.ll1
-rw-r--r--llvm/tools/gold/gold-plugin.cpp6
-rw-r--r--llvm/tools/llc/llc.cpp12
-rw-r--r--llvm/tools/llvm-lto2/llvm-lto2.cpp7
-rw-r--r--llvm/tools/opt/opt.cpp12
32 files changed, 10 insertions, 162 deletions
diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h
index 200706fda7c..fc284f8c677 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -238,10 +238,6 @@ public:
/// records.
std::string OptRecordFile;
- /// The regex that filters the passes that should be saved to the optimization
- /// records.
- std::string OptRecordPasses;
-
/// Regular expression to select optimizations for which we should enable
/// optimization remarks. Transformation passes whose name matches this
/// expression (and support this feature), will emit a diagnostic
diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td
index 2825a927797..f4f8fae39e3 100644
--- a/clang/include/clang/Driver/CC1Options.td
+++ b/clang/include/clang/Driver/CC1Options.td
@@ -603,8 +603,6 @@ def arcmt_migrate : Flag<["-"], "arcmt-migrate">,
def opt_record_file : Separate<["-"], "opt-record-file">,
HelpText<"File name to use for YAML optimization record output">;
-def opt_record_passes : Separate<["-"], "opt-record-passes">,
- HelpText<"Only record remark information for passes whose names match the given regular expression">;
def print_stats : Flag<["-"], "print-stats">,
HelpText<"Print performance metrics and statistics">;
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 0f05effe278..81e4ce75b02 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1715,10 +1715,6 @@ def fno_save_optimization_record : Flag<["-"], "fno-save-optimization-record">,
def foptimization_record_file_EQ : Joined<["-"], "foptimization-record-file=">,
Group<f_Group>,
HelpText<"Specify the file name of any generated YAML optimization record">;
-def foptimization_record_passes_EQ : Joined<["-"], "foptimization-record-passes=">,
- Group<f_Group>,
- HelpText<"Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)">;
-
def ftest_coverage : Flag<["-"], "ftest-coverage">, Group<f_Group>;
def fvectorize : Flag<["-"], "fvectorize">, Group<f_Group>,
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 34705ad8ff8..30a3dc830f6 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -1340,7 +1340,6 @@ static void runThinLTOBackend(ModuleSummaryIndex *CombinedIndex, Module *M,
Conf.DebugPassManager = CGOpts.DebugPassManager;
Conf.RemarksWithHotness = CGOpts.DiagnosticsWithHotness;
Conf.RemarksFilename = CGOpts.OptRecordFile;
- Conf.RemarksPasses = CGOpts.OptRecordPasses;
Conf.DwoPath = CGOpts.SplitDwarfFile;
switch (Action) {
case Backend_EmitNothing:
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index cab3a6bc32b..f59adcd3fb9 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -19,7 +19,6 @@
#include "clang/Basic/TargetInfo.h"
#include "clang/CodeGen/BackendUtil.h"
#include "clang/CodeGen/ModuleBuilder.h"
-#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Lex/Preprocessor.h"
@@ -281,12 +280,6 @@ namespace clang {
Ctx.setRemarkStreamer(llvm::make_unique<RemarkStreamer>(
CodeGenOpts.OptRecordFile, OptRecordFile->os()));
- if (!CodeGenOpts.OptRecordPasses.empty())
- if (Error E = Ctx.getRemarkStreamer()->setFilter(
- CodeGenOpts.OptRecordPasses))
- Diags.Report(diag::err_drv_optimization_remark_pattern)
- << toString(std::move(E)) << CodeGenOpts.OptRecordPasses;
-
if (CodeGenOpts.getProfileUse() != CodeGenOptions::ProfileNone)
Ctx.setDiagnosticsHotnessRequested(true);
}
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index bf9ab9dd107..3bc7412911b 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5032,11 +5032,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_fno_apple_pragma_pack, false))
CmdArgs.push_back("-fapple-pragma-pack");
- // Remarks can be enabled with any of the `-f.*optimization-record.*` flags.
if (Args.hasFlag(options::OPT_fsave_optimization_record,
options::OPT_foptimization_record_file_EQ,
- options::OPT_fno_save_optimization_record, false) ||
- Args.hasFlag(options::OPT_foptimization_record_passes_EQ,
options::OPT_fno_save_optimization_record, false)) {
CmdArgs.push_back("-opt-record-file");
@@ -5071,11 +5068,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
llvm::sys::path::replace_extension(F, "opt.yaml");
CmdArgs.push_back(Args.MakeArgString(F));
}
- if (const Arg *A =
- Args.getLastArg(options::OPT_foptimization_record_passes_EQ)) {
- CmdArgs.push_back("-opt-record-passes");
- CmdArgs.push_back(A->getValue());
- }
}
bool RewriteImports = Args.hasFlag(options::OPT_frewrite_imports,
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index f91ab1946f5..ea93fadcdc2 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -483,14 +483,6 @@ void darwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(Args.MakeArgString(Opt));
}
}
-
- if (const Arg *A =
- Args.getLastArg(options::OPT_foptimization_record_passes_EQ)) {
- CmdArgs.push_back("-mllvm");
- std::string Passes =
- std::string("-lto-pass-remarks-filter=") + A->getValue();
- CmdArgs.push_back(Args.MakeArgString(Passes));
- }
}
// Propagate the -moutline flag to the linker in LTO.
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index b5872b961cc..1cd1cb1ff47 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1218,11 +1218,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
if (!Opts.OptRecordFile.empty())
NeedLocTracking = true;
- if (Arg *A = Args.getLastArg(OPT_opt_record_passes)) {
- Opts.OptRecordPasses = A->getValue();
- NeedLocTracking = true;
- }
-
if (Arg *A = Args.getLastArg(OPT_Rpass_EQ)) {
Opts.OptimizationRemarkPattern =
GenerateOptimizationRemarkRegex(Diags, Args, A);
diff --git a/clang/test/CodeGen/opt-record-MIR.c b/clang/test/CodeGen/opt-record-MIR.c
index f9b4e745805..37239281e9e 100644
--- a/clang/test/CodeGen/opt-record-MIR.c
+++ b/clang/test/CodeGen/opt-record-MIR.c
@@ -3,8 +3,6 @@
// RUN: %clang_cc1 -triple arm64-apple-ios -S -o /dev/null %s -O2 -dwarf-column-info 2>&1 | FileCheck -allow-empty -check-prefix=NO_REMARK %s
// RUN: %clang_cc1 -triple arm64-apple-ios -S -o /dev/null %s -O2 -dwarf-column-info -opt-record-file %t.yaml
// RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s
-// RUN: %clang_cc1 -triple arm64-apple-ios -S -o /dev/null %s -O2 -dwarf-column-info -opt-record-file %t.yaml -opt-record-passes asm-printer
-// RUN: cat %t.yaml | FileCheck -check-prefix=PASSES %s
void bar(float);
@@ -17,15 +15,15 @@ void foo(float *p, int i) {
}
}
-// REMARK: opt-record-MIR.c:{{[1-9][0-9]*}}:{{[1-9][0-9]*}}: remark: {{.}} spills {{.}} reloads generated in loop
+// REMARK: opt-record-MIR.c:10:11: remark: {{.}} spills {{.}} reloads generated in loop
// NO_REMARK-NOT: remark:
// YAML: --- !Missed
// YAML: Pass: regalloc
// YAML: Name: LoopSpillReload
// YAML: DebugLoc: { File: {{[^,]+}},
-// YAML: Line: {{[1-9][0-9]*}}
-// YAML: Column: {{[1-9][0-9]*}} }
+// YAML: Line: 10,
+// YAML: Column: 11 }
// YAML: Function: foo
// YAML: Args:
// YAML: - NumSpills: '{{.}}'
@@ -34,6 +32,3 @@ void foo(float *p, int i) {
// YAML: - String: ' reloads '
// YAML: - String: generated
// YAML: ...
-
-// PASSES: Pass: asm-printer
-// PASSES-NOT: regalloc
diff --git a/clang/test/CodeGen/opt-record.c b/clang/test/CodeGen/opt-record.c
index 3f134854fe5..3bc3c41f784 100644
--- a/clang/test/CodeGen/opt-record.c
+++ b/clang/test/CodeGen/opt-record.c
@@ -3,8 +3,6 @@
// RUN: llvm-profdata merge %S/Inputs/opt-record.proftext -o %t.profdata
// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -fprofile-instrument-use-path=%t.profdata %s -o %t -dwarf-column-info -opt-record-file %t.yaml -emit-obj
// RUN: cat %t.yaml | FileCheck -check-prefix=CHECK -check-prefix=CHECK-PGO %s
-// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -dwarf-column-info -opt-record-file %t.yaml -opt-record-passes inline -emit-obj
-// RUN: cat %t.yaml | FileCheck -check-prefix=CHECK-PASSES %s
// REQUIRES: x86-registered-target
void bar();
@@ -25,7 +23,6 @@ void Test(int *res, int *c, int *d, int *p, int n) {
// CHECK: DebugLoc:
// CHECK: Function: foo
// CHECK-PGO: Hotness:
-// CHECK-PASSES: Pass: inline
// CHECK: --- !Passed
// CHECK: Pass: loop-vectorize
@@ -33,4 +30,4 @@ void Test(int *res, int *c, int *d, int *p, int n) {
// CHECK: DebugLoc:
// CHECK: Function: Test
// CHECK-PGO: Hotness:
-// CHECK-PASSES-NOT: loop-vectorize
+
diff --git a/clang/test/Driver/darwin-ld.c b/clang/test/Driver/darwin-ld.c
index b120bbe8a34..181d4e324cc 100644
--- a/clang/test/Driver/darwin-ld.c
+++ b/clang/test/Driver/darwin-ld.c
@@ -327,10 +327,6 @@
// RUN: FileCheck -check-prefix=PASS_REMARKS_WITH_HOTNESS_THRESHOLD %s < %t.log
// PASS_REMARKS_WITH_HOTNESS_THRESHOLD: "-mllvm" "-lto-pass-remarks-output" "-mllvm" "foo/bar.out.opt.yaml" "-mllvm" "-lto-pass-remarks-with-hotness" "-mllvm" "-lto-pass-remarks-hotness-threshold=100"
-// RUN: %clang -target x86_64-apple-darwin12 %t.o -fsave-optimization-record -foptimization-record-passes=inline -### -o foo/bar.out 2> %t.log
-// RUN: FileCheck -check-prefix=PASS_REMARKS_WITH_PASSES %s < %t.log
-// PASS_REMARKS_WITH_PASSES: "-mllvm" "-lto-pass-remarks-output" "-mllvm" "foo/bar.out.opt.yaml" "-mllvm" "-lto-pass-remarks-filter=inline"
-
// RUN: %clang -target x86_64-apple-ios6.0 -miphoneos-version-min=6.0 -fprofile-instr-generate -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_PROFILE_FIRST %s < %t.log
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -### %t.o 2> %t.log
diff --git a/clang/test/Driver/opt-record.c b/clang/test/Driver/opt-record.c
index 44ad4a2a6b3..7b4ec48632e 100644
--- a/clang/test/Driver/opt-record.c
+++ b/clang/test/Driver/opt-record.c
@@ -12,10 +12,6 @@
// RUN: %clang -### -S -o FOO -foptimization-record-file=BAR.txt %s 2>&1 | FileCheck %s -check-prefix=CHECK-EQ
// RUN: %clang -### -S -o FOO -foptimization-record-file=BAR.txt -fno-save-optimization-record %s 2>&1 | FileCheck %s --check-prefix=CHECK-FOPT-DISABLE
-// RUN: %clang -### -S -o FOO -fsave-optimization-record -foptimization-record-passes=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-EQ-PASSES
-// RUN: %clang -### -S -o FOO -foptimization-record-passes=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-EQ-PASSES
-// RUN: %clang -### -S -o FOO -foptimization-record-passes=inline -fno-save-optimization-record %s 2>&1 | FileCheck %s --check-prefix=CHECK-FOPT-DISABLE-PASSES
-//
// CHECK: "-cc1"
// CHECK: "-opt-record-file" "FOO.opt.yaml"
@@ -27,8 +23,3 @@
// CHECK-EQ: "-opt-record-file" "BAR.txt"
// CHECK-FOPT-DISABLE-NOT: "-fno-save-optimization-record"
-
-// CHECK-EQ-PASSES: "-cc1"
-// CHECK-EQ-PASSES: "-opt-record-passes" "inline"
-
-// CHECK-FOPT-DISABLE-PASSES-NOT: "-fno-save-optimization-record"
diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h
index a6b96b40548..9981098eb6c 100644
--- a/lld/ELF/Config.h
+++ b/lld/ELF/Config.h
@@ -99,7 +99,6 @@ struct Configuration {
llvm::StringRef MapFile;
llvm::StringRef OutputFile;
llvm::StringRef OptRemarksFilename;
- llvm::StringRef OptRemarksPasses;
llvm::StringRef ProgName;
llvm::StringRef SoName;
llvm::StringRef Sysroot;
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index c27e36f94a2..44f2293f199 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -818,7 +818,6 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
Config->OFormatBinary = isOutputFormatBinary(Args);
Config->Omagic = Args.hasFlag(OPT_omagic, OPT_no_omagic, false);
Config->OptRemarksFilename = Args.getLastArgValue(OPT_opt_remarks_filename);
- Config->OptRemarksPasses = Args.getLastArgValue(OPT_opt_remarks_passes);
Config->OptRemarksWithHotness = Args.hasArg(OPT_opt_remarks_with_hotness);
Config->Optimize = args::getInteger(Args, OPT_O, 1);
Config->OrphanHandling = getOrphanHandling(Args);
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index c97ff4d2476..b19996d5e9a 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -97,7 +97,6 @@ static lto::Config createConfig() {
// Set up optimization remarks if we've been asked to.
C.RemarksFilename = Config->OptRemarksFilename;
- C.RemarksPasses = Config->OptRemarksPasses;
C.RemarksWithHotness = Config->OptRemarksWithHotness;
C.SampleProfile = Config->LTOSampleProfile;
diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index 968cf1900b6..013235287b3 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -454,8 +454,6 @@ def disable_verify: F<"disable-verify">;
defm mllvm: Eq<"mllvm", "Additional arguments to forward to LLVM's option processing">;
def opt_remarks_filename: Separate<["--"], "opt-remarks-filename">,
HelpText<"YAML output file for optimization remarks">;
-def opt_remarks_passes: Separate<["--"], "opt-remarks-passes">,
- HelpText<"Regex for the passes that need to be serialized to the output file">;
def opt_remarks_with_hotness: Flag<["--"], "opt-remarks-with-hotness">,
HelpText<"Include hotness information in the optimization remarks file">;
defm plugin_opt: Eq<"plugin-opt", "specifies LTO options for compatibility with GNU linkers">;
diff --git a/lld/docs/ld.lld.1 b/lld/docs/ld.lld.1
index d18914ca509..2e499bac81e 100644
--- a/lld/docs/ld.lld.1
+++ b/lld/docs/ld.lld.1
@@ -329,9 +329,6 @@ Set the text and data sections to be readable and writable.
.It Fl -opt-remarks-filename Ar file
Write optimization remarks in YAML format to
.Ar file .
-.It Fl -opt-remarks-passes Ar pass-regex
-Filter optimization remarks by only allowing the passes matching
-.Ar pass-regex .
.It Fl -opt-remarks-with-hotness
Include hotness information in the optimization remarks file.
.It Fl -orphan-handling Ns = Ns Ar mode
diff --git a/lld/test/ELF/lto/opt-remarks.ll b/lld/test/ELF/lto/opt-remarks.ll
index e37bfd345ac..bef7e016a1c 100644
--- a/lld/test/ELF/lto/opt-remarks.ll
+++ b/lld/test/ELF/lto/opt-remarks.ll
@@ -8,9 +8,6 @@
; RUN: %t.o -o %t -shared
; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
; RUN: cat %t.hot.yaml | FileCheck %s -check-prefix=YAML-HOT
-; RUN: ld.lld --opt-remarks-filename %t1.yaml --opt-remarks-passes inline %t.o \
-; RUN: -o /dev/null -shared
-; RUN: cat %t1.yaml | FileCheck %s -check-prefix=YAML-PASSES
; Check that @tinkywinky is inlined after optimizations.
; CHECK-LABEL: define i32 @main
@@ -51,8 +48,6 @@
; YAML-HOT-NEXT: - String: ')'
; YAML-HOT-NEXT: ...
-; YAML-PASSES: Pass: inline
-
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-scei-ps4"
diff --git a/llvm/include/llvm/IR/RemarkStreamer.h b/llvm/include/llvm/IR/RemarkStreamer.h
index 64de27e3726..38baa2b3b4b 100644
--- a/llvm/include/llvm/IR/RemarkStreamer.h
+++ b/llvm/include/llvm/IR/RemarkStreamer.h
@@ -14,10 +14,8 @@
#define LLVM_IR_REMARKSTREAMER_H
#include "llvm/IR/DiagnosticInfo.h"
-#include "llvm/Support/Error.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/Regex.h"
#include <string>
#include <vector>
@@ -28,8 +26,6 @@ class RemarkStreamer {
const std::string Filename;
/// The open raw_ostream that the remark diagnostics are emitted to.
raw_ostream &OS;
- /// The regex used to filter remarks based on the passes that emit them.
- Optional<Regex> PassFilter;
/// The YAML streamer.
yaml::Output YAMLOutput;
@@ -40,9 +36,6 @@ public:
StringRef getFilename() const { return Filename; }
/// Return stream that the remark diagnostics are emitted to.
raw_ostream &getStream() { return OS; }
- /// Set a pass filter based on a regex \p Filter.
- /// Returns an error if the regex is invalid.
- Error setFilter(StringRef Filter);
/// Emit a diagnostic through the streamer.
void emit(const DiagnosticInfoOptimizationBase &Diag);
};
diff --git a/llvm/include/llvm/LTO/Config.h b/llvm/include/llvm/LTO/Config.h
index 1e2eeab11c0..bf8cc98ac4d 100644
--- a/llvm/include/llvm/LTO/Config.h
+++ b/llvm/include/llvm/LTO/Config.h
@@ -96,9 +96,6 @@ struct Config {
/// Optimization remarks file path.
std::string RemarksFilename = "";
- /// Optimization remarks pass filter.
- std::string RemarksPasses = "";
-
/// Whether to emit optimization remarks with hotness informations.
bool RemarksWithHotness = false;
diff --git a/llvm/include/llvm/LTO/LTO.h b/llvm/include/llvm/LTO/LTO.h
index be37dbd0c59..ab4d874b55e 100644
--- a/llvm/include/llvm/LTO/LTO.h
+++ b/llvm/include/llvm/LTO/LTO.h
@@ -84,7 +84,6 @@ std::string getThinLTOOutputFile(const std::string &Path,
/// Setup optimization remarks.
Expected<std::unique_ptr<ToolOutputFile>>
setupOptimizationRemarks(LLVMContext &Context, StringRef LTORemarksFilename,
- StringRef LTORemarksPasses,
bool LTOPassRemarksWithHotness, int Count = -1);
class LTO;
diff --git a/llvm/lib/IR/RemarkStreamer.cpp b/llvm/lib/IR/RemarkStreamer.cpp
index 022c17d6722..0b983408e46 100644
--- a/llvm/lib/IR/RemarkStreamer.cpp
+++ b/llvm/lib/IR/RemarkStreamer.cpp
@@ -21,21 +21,7 @@ RemarkStreamer::RemarkStreamer(StringRef Filename, raw_ostream &OS)
assert(!Filename.empty() && "This needs to be a real filename.");
}
-Error RemarkStreamer::setFilter(StringRef Filter) {
- Regex R = Regex(Filter);
- std::string RegexError;
- if (!R.isValid(RegexError))
- return createStringError(std::make_error_code(std::errc::invalid_argument),
- RegexError.data());
- PassFilter = std::move(R);
- return Error::success();
-}
-
void RemarkStreamer::emit(const DiagnosticInfoOptimizationBase &Diag) {
- if (Optional<Regex> &Filter = PassFilter)
- if (!Filter->match(Diag.getPassName()))
- return;
-
DiagnosticInfoOptimizationBase *DiagPtr =
const_cast<DiagnosticInfoOptimizationBase *>(&Diag);
YAMLOutput << DiagPtr;
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 99318c19a89..f6e34c5d061 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -1312,7 +1312,6 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache) {
Expected<std::unique_ptr<ToolOutputFile>>
lto::setupOptimizationRemarks(LLVMContext &Context,
StringRef LTORemarksFilename,
- StringRef LTORemarksPasses,
bool LTOPassRemarksWithHotness, int Count) {
if (LTOPassRemarksWithHotness)
Context.setDiagnosticsHotnessRequested(true);
@@ -1330,11 +1329,6 @@ lto::setupOptimizationRemarks(LLVMContext &Context,
return errorCodeToError(EC);
Context.setRemarkStreamer(
llvm::make_unique<RemarkStreamer>(Filename, DiagnosticFile->os()));
-
- if (!LTORemarksPasses.empty())
- if (Error E = Context.getRemarkStreamer()->setFilter(LTORemarksPasses))
- return std::move(E);
-
DiagnosticFile->keep();
return std::move(DiagnosticFile);
}
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 64c596931fa..0595771bd00 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -429,9 +429,8 @@ Error lto::backend(Config &C, AddStreamFn AddStream,
std::unique_ptr<TargetMachine> TM = createTargetMachine(C, *TOrErr, *Mod);
// Setup optimization remarks.
- auto DiagFileOrErr =
- lto::setupOptimizationRemarks(Mod->getContext(), C.RemarksFilename,
- C.RemarksPasses, C.RemarksWithHotness);
+ auto DiagFileOrErr = lto::setupOptimizationRemarks(
+ Mod->getContext(), C.RemarksFilename, C.RemarksWithHotness);
if (!DiagFileOrErr)
return DiagFileOrErr.takeError();
auto DiagnosticOutputFile = std::move(*DiagFileOrErr);
@@ -485,8 +484,7 @@ Error lto::thinBackend(Config &Conf, unsigned Task, AddStreamFn AddStream,
// Setup optimization remarks.
auto DiagFileOrErr = lto::setupOptimizationRemarks(
- Mod.getContext(), Conf.RemarksFilename, Conf.RemarksPasses,
- Conf.RemarksWithHotness, Task);
+ Mod.getContext(), Conf.RemarksFilename, Conf.RemarksWithHotness, Task);
if (!DiagFileOrErr)
return DiagFileOrErr.takeError();
auto DiagnosticOutputFile = std::move(*DiagFileOrErr);
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index f02907f7a86..1b1de2ba187 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -85,12 +85,6 @@ cl::opt<std::string>
cl::desc("Output filename for pass remarks"),
cl::value_desc("filename"));
-cl::opt<std::string>
- LTORemarksPasses("lto-pass-remarks-filter",
- cl::desc("Only record optimization remarks from passes "
- "whose names match the given regular expression"),
- cl::value_desc("regex"));
-
cl::opt<bool> LTOPassRemarksWithHotness(
"lto-pass-remarks-with-hotness",
cl::desc("With PGO, include profile count in optimization remarks"),
@@ -511,7 +505,7 @@ bool LTOCodeGenerator::optimize(bool DisableVerify, bool DisableInline,
return false;
auto DiagFileOrErr = lto::setupOptimizationRemarks(
- Context, LTORemarksFilename, LTORemarksPasses, LTOPassRemarksWithHotness);
+ Context, LTORemarksFilename, LTOPassRemarksWithHotness);
if (!DiagFileOrErr) {
errs() << "Error: " << toString(DiagFileOrErr.takeError()) << "\n";
report_fatal_error("Can't get an output file for the remarks");
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
index d4ee66a53e0..557afd6c360 100644
--- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -70,7 +70,6 @@ namespace llvm {
// Flags -discard-value-names, defined in LTOCodeGenerator.cpp
extern cl::opt<bool> LTODiscardValueNames;
extern cl::opt<std::string> LTORemarksFilename;
-extern cl::opt<std::string> LTORemarksPasses;
extern cl::opt<bool> LTOPassRemarksWithHotness;
}
@@ -973,8 +972,7 @@ void ThinLTOCodeGenerator::run() {
Context.setDiscardValueNames(LTODiscardValueNames);
Context.enableDebugTypeODRUniquing();
auto DiagFileOrErr = lto::setupOptimizationRemarks(
- Context, LTORemarksFilename, LTORemarksPasses,
- LTOPassRemarksWithHotness, count);
+ Context, LTORemarksFilename, LTOPassRemarksWithHotness, count);
if (!DiagFileOrErr) {
errs() << "Error: " << toString(DiagFileOrErr.takeError()) << "\n";
report_fatal_error("ThinLTO: Can't get an output file for the "
diff --git a/llvm/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll b/llvm/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
index beb0f4fa49b..03db4a722b5 100644
--- a/llvm/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
+++ b/llvm/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
@@ -4,7 +4,6 @@
; RUN: llvm-as < %s >%t.bc
; RUN: rm -f %t.yaml
; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
-; RUN: -pass-remarks-filter=inline \
; RUN: -r %t.bc,tinkywinky,p \
; RUN: -r %t.bc,patatino,px \
; RUN: -r %t.bc,main,px -o %t.o %t.bc
@@ -14,7 +13,6 @@
; RUN: opt -module-summary %s -o %t.bc
; RUN: rm -f %t.thin.1.yaml
; RUN: llvm-lto2 run -pass-remarks-output=%t \
-; RUN: -pass-remarks-filter=inline \
; RUN: -r %t.bc,tinkywinky,p \
; RUN: -r %t.bc,patatino,px \
; RUN: -r %t.bc,main,px -o %t.o %t.bc
diff --git a/llvm/test/ThinLTO/X86/diagnostic-handler-remarks.ll b/llvm/test/ThinLTO/X86/diagnostic-handler-remarks.ll
index 4c13fe804d6..d4606ba999d 100644
--- a/llvm/test/ThinLTO/X86/diagnostic-handler-remarks.ll
+++ b/llvm/test/ThinLTO/X86/diagnostic-handler-remarks.ll
@@ -5,7 +5,6 @@
; RUN: rm -f %t.yaml.thin.0.yaml %t.yaml.thin.1.yaml
; RUN: llvm-lto -thinlto-action=run \
; RUN: -lto-pass-remarks-output=%t.yaml \
-; RUN: -lto-pass-remarks-filter=inline \
; RUN: -exported-symbol _func2 \
; RUN: -exported-symbol _main %t1.bc %t2.bc 2>&1 | \
; RUN: FileCheck %s -allow-empty
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index dc61ff925ce..fbf78b02551 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -205,9 +205,8 @@ namespace options {
/// Statistics output filename.
static std::string stats_file;
- // Optimization remarks filename, accepted passes and hotness options
+ // Optimization remarks filename and hotness options
static std::string OptRemarksFilename;
- static std::string OptRemarksFilter;
static bool OptRemarksWithHotness = false;
// Context sensitive PGO options.
@@ -286,8 +285,6 @@ namespace options {
dwo_dir = opt.substr(strlen("dwo_dir="));
} else if (opt.startswith("opt-remarks-filename=")) {
OptRemarksFilename = opt.substr(strlen("opt-remarks-filename="));
- } else if (opt.startswith("opt-remarks-passes=")) {
- OptRemarksFilter = opt.substr(strlen("opt-remarks-passes="));
} else if (opt == "opt-remarks-with-hotness") {
OptRemarksWithHotness = true;
} else if (opt.startswith("stats-file=")) {
@@ -911,7 +908,6 @@ static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite,
// Set up optimization remarks handling.
Conf.RemarksFilename = options::OptRemarksFilename;
- Conf.RemarksPasses = options::OptRemarksFilter;
Conf.RemarksWithHotness = options::OptRemarksWithHotness;
// Use new pass manager if set in driver
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index be103845e97..a566d15cd81 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -148,12 +148,6 @@ static cl::opt<std::string>
cl::desc("YAML output filename for pass remarks"),
cl::value_desc("filename"));
-static cl::opt<std::string>
- RemarksPasses("pass-remarks-filter",
- cl::desc("Only record optimization remarks from passes whose "
- "names match the given regular expression"),
- cl::value_desc("regex"));
-
namespace {
static ManagedStatic<std::vector<std::string>> RunPassNames;
@@ -342,12 +336,6 @@ int main(int argc, char **argv) {
}
Context.setRemarkStreamer(
llvm::make_unique<RemarkStreamer>(RemarksFilename, YamlFile->os()));
-
- if (!RemarksPasses.empty())
- if (Error E = Context.getRemarkStreamer()->setFilter(RemarksPasses)) {
- WithColor::error(errs(), argv[0]) << E << '\n';
- return 1;
- }
}
if (InputLanguage != "" && InputLanguage != "ir" &&
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
index df51921396a..6cceb8e4cf8 100644
--- a/llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -101,12 +101,6 @@ static cl::opt<bool> OptRemarksWithHotness(
"Has effect only if -pass-remarks-output is specified."));
static cl::opt<std::string>
- OptRemarksPasses("pass-remarks-filter",
- cl::desc("Only record optimization remarks from passes "
- "whose names match the given regular expression"),
- cl::value_desc("regex"));
-
-static cl::opt<std::string>
SamplePGOFile("lto-sample-profile-file",
cl::desc("Specify a SamplePGO profile file"));
@@ -226,7 +220,6 @@ static int run(int argc, char **argv) {
// Optimization remarks.
Conf.RemarksFilename = OptRemarksOutput;
- Conf.RemarksPasses = OptRemarksPasses;
Conf.RemarksWithHotness = OptRemarksWithHotness;
Conf.SampleProfile = SamplePGOFile;
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index b4c39e2fca8..06745b0cca0 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -275,12 +275,6 @@ static cl::opt<std::string>
cl::desc("YAML output filename for pass remarks"),
cl::value_desc("filename"));
-static cl::opt<std::string>
- RemarksPasses("pass-remarks-filter",
- cl::desc("Only record optimization remarks from passes whose "
- "names match the given regular expression"),
- cl::value_desc("regex"));
-
cl::opt<PGOKind>
PGOKindFlag("pgo-kind", cl::init(NoPGO), cl::Hidden,
cl::desc("The kind of profile guided optimization"),
@@ -572,12 +566,6 @@ int main(int argc, char **argv) {
}
Context.setRemarkStreamer(llvm::make_unique<RemarkStreamer>(
RemarksFilename, OptRemarkFile->os()));
-
- if (!RemarksPasses.empty())
- if (Error E = Context.getRemarkStreamer()->setFilter(RemarksPasses)) {
- errs() << E << '\n';
- return 1;
- }
}
// Load the input module...
OpenPOWER on IntegriCloud