[mlir] Clear running passes in crashreporter
authorJacques Pienaar <jpienaar@google.com>
Wed, 21 Dec 2022 19:43:03 +0000 (11:43 -0800)
committerJacques Pienaar <jpienaar@google.com>
Wed, 21 Dec 2022 19:43:03 +0000 (11:43 -0800)
commit383329b3a8881bda8d5989439d37b75a5f732f5f
tree548e2bad72955661b81b0cbd5054f5437f59c420
parent62a410f65100cceba0e4eeaa38b803d890afc89e
[mlir] Clear running passes in crashreporter

Clear active contexts and running passes whenever finalizing crash
report message. Ran into segfault where a failure in dynamic pipeline
resulted in querying a pass whose passmanager had already been destroyed
come time for creating summary of running passes. Conservatively clear
both running states as I don't think there is recovery intended from
pass pipeline failure.

Additionally restrict to one reproducer per report - else we end up
clobbering the same reproducer file over and over again. So instead of
ending with last reproducer we now end up with the first reproducer
while not creating and clobbering reproducers over and over again.

Differential Revision: https://reviews.llvm.org/D140488
mlir/lib/Pass/PassCrashRecovery.cpp