diff options
author | Florian Hahn <flo@fhahn.com> | 2019-10-29 13:41:19 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2019-10-29 14:24:05 +0000 |
commit | 43a46f1c09380f65bf18d39c16c5145bfe48af45 (patch) | |
tree | d4a9bf557ac9e8bdcec0019dd55bc8a1790fb743 | |
parent | fe5292545f768592fa1d8881c3b8c1bca43f8dfb (diff) | |
download | bcm5719-llvm-43a46f1c09380f65bf18d39c16c5145bfe48af45.tar.gz bcm5719-llvm-43a46f1c09380f65bf18d39c16c5145bfe48af45.zip |
[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
-rw-r--r-- | llvm/tools/bugpoint/CrashDebugger.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index aab9debf9b5..de86fc27f22 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) { |