[llvm] 43a46f1 - [bugpoint] Try to reduce passes after reducing everything.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 07:26:13 PDT 2019


Author: Florian Hahn
Date: 2019-10-29T14:24:05Z
New Revision: 43a46f1c09380f65bf18d39c16c5145bfe48af45

URL: https://github.com/llvm/llvm-project/commit/43a46f1c09380f65bf18d39c16c5145bfe48af45
DIFF: https://github.com/llvm/llvm-project/commit/43a46f1c09380f65bf18d39c16c5145bfe48af45.diff

LOG: [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

Added: 
    

Modified: 
    llvm/tools/bugpoint/CrashDebugger.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index aab9debf9b59..de86fc27f225 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) {


        


More information about the llvm-commits mailing list