diff options
| author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-03-12 20:54:18 +0000 |
|---|---|---|
| committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-03-12 20:54:18 +0000 |
| commit | 1d6c47ad2bb2ed6aef76107fb345fbf4cb024cb4 (patch) | |
| tree | f6a92a25a34cae50f0d0795bdb2a8f4737d5f85d /llvm | |
| parent | 7e44a8440c55a3592901c3c2290cf25ca5c78619 (diff) | |
| download | bcm5719-llvm-1d6c47ad2bb2ed6aef76107fb345fbf4cb024cb4.tar.gz bcm5719-llvm-1d6c47ad2bb2ed6aef76107fb345fbf4cb024cb4.zip | |
Revert "[Remarks] Add -foptimization-record-passes to filter remark emission"
This reverts commit 20fff32b7d1f1a1bd417b22aa9f26ededd97a3e5.
llvm-svn: 355976
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/IR/RemarkStreamer.h | 7 | ||||
| -rw-r--r-- | llvm/include/llvm/LTO/Config.h | 3 | ||||
| -rw-r--r-- | llvm/include/llvm/LTO/LTO.h | 1 | ||||
| -rw-r--r-- | llvm/lib/IR/RemarkStreamer.cpp | 14 | ||||
| -rw-r--r-- | llvm/lib/LTO/LTO.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/LTO/LTOBackend.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/LTO/LTOCodeGenerator.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 4 | ||||
| -rw-r--r-- | llvm/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll | 2 | ||||
| -rw-r--r-- | llvm/test/ThinLTO/X86/diagnostic-handler-remarks.ll | 1 | ||||
| -rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 6 | ||||
| -rw-r--r-- | llvm/tools/llc/llc.cpp | 12 | ||||
| -rw-r--r-- | llvm/tools/llvm-lto2/llvm-lto2.cpp | 7 | ||||
| -rw-r--r-- | llvm/tools/opt/opt.cpp | 12 |
14 files changed, 6 insertions, 85 deletions
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... |

