If we're debugging the SimplifyCFG pass, we _REALLY_ don't want to use it for
authorChris Lattner <sabre@nondot.org>
Tue, 5 Aug 2003 15:51:05 +0000 (15:51 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 5 Aug 2003 15:51:05 +0000 (15:51 +0000)
narrowing, no matter what.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7596 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/BugDriver.h
tools/bugpoint/CrashDebugger.cpp
tools/bugpoint/ExtractFunction.cpp

index f86782a0bc937661612415e53d43ee15799ccad3..eff11ec0de476974c25296f97d04cfd0c39b4bd3 100644 (file)
@@ -27,6 +27,8 @@ class ReduceCrashingBlocks;
 class CBE;
 class GCC;
 
 class CBE;
 class GCC;
 
+extern bool DisableSimplifyCFG;
+
 class BugDriver {
   const std::string ToolName;  // Name of bugpoint
   std::string ReferenceOutputFile; // Name of `good' output file
 class BugDriver {
   const std::string ToolName;  // Name of bugpoint
   std::string ReferenceOutputFile; // Name of `good' output file
index 872725593e28440e10e1c44dac82a6317be08e4a..e969d5e0be6d6b6cecf33718e9c7e7ca7fcebf6a 100644 (file)
@@ -304,11 +304,13 @@ bool BugDriver::debugCrash() {
   // to a return instruction then running simplifycfg, which can potentially
   // shrinks the code dramatically quickly
   //
   // to a return instruction then running simplifycfg, which can potentially
   // shrinks the code dramatically quickly
   //
-  std::vector<BasicBlock*> Blocks;
-  for (Module::iterator I = Program->begin(), E = Program->end(); I != E; ++I)
-    for (Function::iterator FI = I->begin(), E = I->end(); FI != E; ++FI)
-      Blocks.push_back(FI);
-  ReduceCrashingBlocks(*this).reduceList(Blocks);
+  if (!DisableSimplifyCFG) {
+    std::vector<BasicBlock*> Blocks;
+    for (Module::iterator I = Program->begin(), E = Program->end(); I != E; ++I)
+      for (Function::iterator FI = I->begin(), E = I->end(); FI != E; ++FI)
+        Blocks.push_back(FI);
+    ReduceCrashingBlocks(*this).reduceList(Blocks);
+  }
 
   // FIXME: This should use the list reducer to converge faster by deleting
   // larger chunks of instructions at a time!
 
   // FIXME: This should use the list reducer to converge faster by deleting
   // larger chunks of instructions at a time!
index 525c7467f163013d9f9be5492b755ff7614c2968..9cb922a55d4a2b98ddfe80b3ed8c7703ff25a54e 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Constant.h"
 #include "Support/CommandLine.h"
 
 #include "llvm/Constant.h"
 #include "Support/CommandLine.h"
 
+bool DisableSimplifyCFG = false;
+
 namespace {
   cl::opt<bool>
   NoADCE("disable-adce",
 namespace {
   cl::opt<bool>
   NoADCE("disable-adce",
@@ -23,8 +25,8 @@ namespace {
   cl::opt<bool>
   NoDCE ("disable-dce",
          cl::desc("Do not use the -dce pass to reduce testcases"));
   cl::opt<bool>
   NoDCE ("disable-dce",
          cl::desc("Do not use the -dce pass to reduce testcases"));
-  cl::opt<bool>
-  NoSCFG("disable-simplifycfg",
+  cl::opt<bool, true>
+  NoSCFG("disable-simplifycfg", cl::location(DisableSimplifyCFG),
          cl::desc("Do not use the -simplifycfg pass to reduce testcases"));
   cl::opt<bool>
   NoFinalCleanup("disable-final-cleanup",
          cl::desc("Do not use the -simplifycfg pass to reduce testcases"));
   cl::opt<bool>
   NoFinalCleanup("disable-final-cleanup",
@@ -67,7 +69,7 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I,
   //Passes.add(createInstructionCombiningPass());
   if (Simplification > 1 && !NoDCE)
     Passes.add(createDeadCodeEliminationPass());
   //Passes.add(createInstructionCombiningPass());
   if (Simplification > 1 && !NoDCE)
     Passes.add(createDeadCodeEliminationPass());
-  if (Simplification && !NoSCFG)
+  if (Simplification && !DisableSimplifyCFG)
     Passes.add(createCFGSimplificationPass());      // Delete dead control flow
 
   Passes.add(createVerifierPass());
     Passes.add(createCFGSimplificationPass());      // Delete dead control flow
 
   Passes.add(createVerifierPass());