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

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 28 18:58:49 PDT 2021


aeubanks added a comment.

back to the mutex discussion, I feel like it's a very narrow use case to use --print-on-crash with multiple threads
I'd rather land this without the mutex stuff and add the mutex stuff later if we really decide we need it



================
Comment at: llvm/lib/Passes/PassBuilder.cpp:364
+public:
+  PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
+};
----------------
this should probably be a module pass


================
Comment at: llvm/lib/Passes/PassBuilder.cpp:369
+PreservedAnalyses TriggerCrashPass::run(Function &, FunctionAnalysisManager &) {
+  assert(false);
+}
----------------
I'd move the definition into the class definition


================
Comment at: llvm/test/Other/print-on-crash.ll:3
+; which gets called when a pass crashes.  The trigger-crash pass calls
+; __builtin_trap.
+
----------------
not true anymore


================
Comment at: llvm/test/Other/print-on-crash.ll:14
+
+; The input corresponds to "int main() { return 0; }" but is irrelevant.
+
----------------
unnecessary comment


================
Comment at: llvm/test/Other/print-on-crash.ll:1
+; A test that the hidden option -print-on-crash properly sets a signal handler
+; which gets called when a pass crashes.  The trigger-crash pass calls
----------------
we should probably add `REQUIRES: asserts` to make sure the assert in the pass triggers


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

https://reviews.llvm.org/D86657



More information about the llvm-commits mailing list