Skip to content

Commit 43a46f1

Browse files
committed
[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
1 parent fe52925 commit 43a46f1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

llvm/tools/bugpoint/CrashDebugger.cpp

+15-1
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,21 @@ Error BugDriver::debugOptimizerCrash(const std::string &ID) {
12891289

12901290
EmitProgressBitcode(*Program, ID);
12911291

1292-
return DebugACrash(*this, TestForOptimizerCrash);
1292+
auto Res = DebugACrash(*this, TestForOptimizerCrash);
1293+
if (Res || DontReducePassList)
1294+
return Res;
1295+
// Try to reduce the pass list again. This covers additional cases
1296+
// we failed to reduce earlier, because of more complex pass dependencies
1297+
// triggering the crash.
1298+
auto SecondRes = ReducePassList(*this).reduceList(PassesToRun);
1299+
if (Error E = SecondRes.takeError())
1300+
return E;
1301+
outs() << "\n*** Found crashing pass"
1302+
<< (PassesToRun.size() == 1 ? ": " : "es: ")
1303+
<< getPassesString(PassesToRun) << '\n';
1304+
1305+
EmitProgressBitcode(getProgram(), "reduced-simplified");
1306+
return Res;
12931307
}
12941308

12951309
static bool TestForCodeGenCrash(const BugDriver &BD, Module *M) {

0 commit comments

Comments
 (0)