[PATCH] D59268: [Remarks] Add -foptimization-record-passes to filter remark emission

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 10:58:26 PDT 2019


thegameg created this revision.
thegameg added reviewers: anemet, paquette, JDevlieghere, fhahn.
Herald added subscribers: dang, dexonsmith, steven_wu, MaskRay, hiraditya, eraman, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

Currently we have `-Rpass` for filtering the remarks that are displayed as diagnostics, but when using `-fsave-optimization-record`, there is no way to filter the remarks while generating them.

This adds support for filtering remarks by passes using a regex.

Ex:

`clang -fsave-optimization-record -foptimization-record-passes=inline`

will only emit the remarks coming from the pass `inline`.

This adds:

- `-fsave-optimization-record` to the driver
- `-opt-record-passes` to cc1
- `-lto-pass-remarks-passes` to the LTOCodeGenerator
- `--opt-remarks-passes` to lld
- `-pass-remarks-passes` to llc, opt, llvm-lto, llvm-lto2
- `-opt-remarks-passes` to gold-plugin

The naming is chosen to be consistent with the output filename.


https://reviews.llvm.org/D59268

Files:
  clang/include/clang/Basic/CodeGenOptions.h
  clang/include/clang/Driver/CC1Options.td
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/CodeGen/CodeGenAction.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/opt-record-MIR.c
  clang/test/CodeGen/opt-record.c
  clang/test/Driver/darwin-ld.c
  clang/test/Driver/opt-record.c
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/LTO.cpp
  lld/ELF/Options.td
  lld/docs/ld.lld.1
  lld/test/ELF/lto/opt-remarks.ll
  llvm/include/llvm/IR/RemarkStreamer.h
  llvm/include/llvm/LTO/Config.h
  llvm/include/llvm/LTO/LTO.h
  llvm/lib/IR/RemarkStreamer.cpp
  llvm/lib/LTO/LTO.cpp
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/LTO/LTOCodeGenerator.cpp
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  llvm/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
  llvm/test/ThinLTO/X86/diagnostic-handler-remarks.ll
  llvm/tools/gold/gold-plugin.cpp
  llvm/tools/llc/llc.cpp
  llvm/tools/llvm-lto2/llvm-lto2.cpp
  llvm/tools/opt/opt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59268.190293.patch
Type: text/x-patch
Size: 27322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190312/cf970489/attachment-0001.bin>


More information about the llvm-commits mailing list