[llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Apr 25 17:09:01 PDT 2003


Changes in directory llvm/tools/bugpoint:

ExtractFunction.cpp updated: 1.6 -> 1.7

---
Log message:

Add options to disable simplification with passes, in case one of them crashes


---
Diffs of the changes:

Index: llvm/tools/bugpoint/ExtractFunction.cpp
diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.6 llvm/tools/bugpoint/ExtractFunction.cpp:1.7
--- llvm/tools/bugpoint/ExtractFunction.cpp:1.6	Thu Apr 24 19:52:30 2003
+++ llvm/tools/bugpoint/ExtractFunction.cpp	Fri Apr 25 17:08:12 2003
@@ -14,6 +14,19 @@
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Type.h"
 #include "llvm/Constant.h"
+#include "Support/CommandLine.h"
+
+namespace {
+  cl::opt<bool>
+  NoADCE("disable-adce",
+         cl::desc("Do not use the -adce 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::desc("Do not use the -simplifycfg pass to reduce testcases"));
+}
 
 /// deleteInstructionFromProgram - This method clones the current Program and
 /// deletes the specified instruction from the cloned module.  It then runs a
@@ -46,12 +59,12 @@
 
   // Spiff up the output a little bit.
   PassManager Passes;
-  if (Simplification > 2)
+  if (Simplification > 2 && !NoADCE)
     Passes.add(createAggressiveDCEPass());          // Remove dead code...
   //Passes.add(createInstructionCombiningPass());
-  if (Simplification > 1)
+  if (Simplification > 1 && !NoDCE)
     Passes.add(createDeadCodeEliminationPass());
-  if (Simplification)
+  if (Simplification && !NoSCFG)
     Passes.add(createCFGSimplificationPass());      // Delete dead control flow
 
   Passes.add(createVerifierPass());





More information about the llvm-commits mailing list