[mlir] Refactor pass crash reproducer generation to be an assembly resource
authorRiver Riddle <riddleriver@gmail.com>
Tue, 28 Jun 2022 20:39:15 +0000 (13:39 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Wed, 29 Jun 2022 19:14:02 +0000 (12:14 -0700)
commit361acbb3627240d049407a164b355b50086f6d79
tree519a7fa1ad5a413c2473852654cd2754e47164cf
parentea488bd6e1f7bf52d6ec7a40c7116670f06e92a6
[mlir] Refactor pass crash reproducer generation to be an assembly resource

We currently generate reproducer configurations using a comment placed at
the top of the generated .mlir file. This is kind of hacky given that comments
have no semantic context in the source file and can easily be dropped. This
strategy also wouldn't work if/when we have a bitcode format. This commit
switches to using an external assembly resource, which is verifiable/can
work with a hypothetical bitcode naturally/and removes the awkward processing
from mlir-opt for splicing comments and re-applying command line options. With
the removal of command line munging, this opens up new possibilities for
executing reproducers in memory.

Differential Revision: https://reviews.llvm.org/D126447
mlir/include/mlir/Pass/PassRegistry.h
mlir/lib/Pass/PassCrashRecovery.cpp
mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
mlir/test/Pass/crash-recovery-dynamic-failure.mlir
mlir/test/Pass/crash-recovery.mlir
mlir/test/Pass/run-reproducer.mlir
mlir/test/lib/Dialect/SPIRV/TestModuleCombiner.cpp