From 43a46f1c09380f65bf18d39c16c5145bfe48af45 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Tue, 29 Oct 2019 13:41:19 +0000 Subject: [PATCH] [bugpoint] Try to reduce passes after reducing everything. In some cases, we fail to reduce the pass list earlier because of complex pass dependencies, but we can reduce it after we simplified the reproducer. An example of that is PR43474, which can limit the crash to -loop-interchange. Adding a test case would require at least 2 interacting Loop passes I think. Reviewers: davide, reames, modocache Reviewed By: reames Differential Revision: https://reviews.llvm.org/D69236 --- llvm/tools/bugpoint/CrashDebugger.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index aab9deb..de86fc2 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -1289,7 +1289,21 @@ Error BugDriver::debugOptimizerCrash(const std::string &ID) { EmitProgressBitcode(*Program, ID); - return DebugACrash(*this, TestForOptimizerCrash); + auto Res = DebugACrash(*this, TestForOptimizerCrash); + if (Res || DontReducePassList) + return Res; + // Try to reduce the pass list again. This covers additional cases + // we failed to reduce earlier, because of more complex pass dependencies + // triggering the crash. + auto SecondRes = ReducePassList(*this).reduceList(PassesToRun); + if (Error E = SecondRes.takeError()) + return E; + outs() << "\n*** Found crashing pass" + << (PassesToRun.size() == 1 ? ": " : "es: ") + << getPassesString(PassesToRun) << '\n'; + + EmitProgressBitcode(getProgram(), "reduced-simplified"); + return Res; } static bool TestForCodeGenCrash(const BugDriver &BD, Module *M) { -- 2.7.4