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

Daniil Suchkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 1 16:06:08 PDT 2021


DaniilSuchkov added a comment.

In D86657#3037670 <https://reviews.llvm.org/D86657#3037670>, @aeubanks wrote:

> The title needs updating for the option name
>
> Btw I just tried this on a very large file with a (real) LLVM crash and it was very slow and I gave up. It's probably from printing the IR after every pass. Perhaps cloning the module via `CloneModule()` and keeping that around might be faster?

Keep in mind that:
a) This is still (supposedly) quality of life an improvement over using `-print-after-all -print-module-scope`. In my experience `-print-after-all -print-module-scope` in some cases can take hours (and then I have to deal with a few GB long log).
b) There are bugs that can corrupt IR in other modules (like the one I fixed here: D110752 <https://reviews.llvm.org/D110752>), so keeping a live `Module` object isn't the best idea.

Serializing the module into the binary representation and then de-serizalining and printing it upon crash is an option, though I'm not sure it's robust enough, since the LLVMContext can be arbitrarily broken at that point.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86657/new/

https://reviews.llvm.org/D86657



More information about the llvm-commits mailing list