[PATCH] D122696: [bugpoint] Don't try to reduce pass list if we only have one

Keno Fischer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 17:13:36 PDT 2022


loladiro created this revision.
loladiro added reviewers: fhahn, reames.
Herald added a project: All.
loladiro requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

If there's only one possible pass, we know that reduction will
do nothing, but currently it still runs a test iterastion on that
one pass. This can take a fair bit of time, particularly since this
runs very early, so the input module is likely to be huge. Just skip
the pass reduction step if there is already only one pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122696

Files:
  llvm/tools/bugpoint/CrashDebugger.cpp


Index: llvm/tools/bugpoint/CrashDebugger.cpp
===================================================================
--- llvm/tools/bugpoint/CrashDebugger.cpp
+++ llvm/tools/bugpoint/CrashDebugger.cpp
@@ -1377,7 +1377,7 @@
   outs() << "\n*** Debugging optimizer crash!\n";
 
   // Reduce the list of passes which causes the optimizer to crash...
-  if (!BugpointIsInterrupted && !DontReducePassList) {
+  if (!BugpointIsInterrupted && !DontReducePassList && PassesToRun.size() > 1) {
     Expected<bool> Result = ReducePassList(*this).reduceList(PassesToRun);
     if (Error E = Result.takeError())
       return E;
@@ -1390,7 +1390,7 @@
   EmitProgressBitcode(*Program, ID);
 
   auto Res = DebugACrash(*this, TestForOptimizerCrash);
-  if (Res || DontReducePassList)
+  if (Res || DontReducePassList || PassesToRun.size() == 1)
     return Res;
   // Try to reduce the pass list again. This covers additional cases
   // we failed to reduce earlier, because of more complex pass dependencies


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122696.419018.patch
Type: text/x-patch
Size: 991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220330/848868e2/attachment.bin>


More information about the llvm-commits mailing list