[PATCH] D86657: Add new hidden option -print-crash-IR that prints out IR that caused opt pipeline to crash

Jamie Schmeiser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 13:26:59 PDT 2020


jamieschmeiser created this revision.
jamieschmeiser added reviewers: kula, aeubanks, yrouban.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
jamieschmeiser requested review of this revision.

A new hidden option -print-crash-IR that prints the IR as it was upon entering
the last pass when there is a crash.

The IR is saved in its print form before each pass is started and a
signal handler is registered.  If the compilation crashes, the signal
handler will print the saved IR to dbgs().  This option
can be modified using -print-module-scope to get the IR for the complete
module.  Note that this option only works with the new pass manager.

Although it is not included in the patch, this was tested by adding a hidden
option to a pass that caused the pass to call __builtin_trap().


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86657

Files:
  llvm/include/llvm/Passes/StandardInstrumentations.h
  llvm/lib/Passes/StandardInstrumentations.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86657.288096.patch
Type: text/x-patch
Size: 3711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200826/19faee95/attachment.bin>


More information about the llvm-commits mailing list