After reducing a miscompiled program down to the functions which are being
miscompiled, try to use the loop extractor to reduce the program down to a
loop nest that is being miscompiled.  In practice, the loop extractor appears
to have too many bugs for this to be useful, but hopefully they will be fixed
soon...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12398 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index 53afd47..e8fe499 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -131,7 +131,11 @@
 
   Module *NewM = runPassesOn(M, LoopExtractPasses);
   if (NewM == 0) {
-    std::cerr << "Loop extraction failed.  Sorry. :(  Please report a bug!\n";
+    Module *Old = swapProgramIn(M);
+    std::cout << "*** Loop extraction failed: ";
+    EmitProgressBytecode("loopextraction", true);
+    std::cout << "*** Sorry. :(  Please report a bug!\n";
+    swapProgramIn(Old);
     return 0;
   }