diff options
Diffstat (limited to 'llvm/tools/opt/opt.cpp')
-rw-r--r-- | llvm/tools/opt/opt.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index 06745b0cca0..b4c39e2fca8 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -275,6 +275,12 @@ 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"), @@ -566,6 +572,12 @@ 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... |