diff options
author | Chris Lattner <sabre@nondot.org> | 2003-04-25 22:08:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-04-25 22:08:12 +0000 |
commit | 8d8de422dd787535df26890e3e7c9e3aa8f63cfe (patch) | |
tree | ed8585f9b63dedc5c2343f7c156e384ded5f9760 /llvm/tools/bugpoint/ExtractFunction.cpp | |
parent | 2a2338f1ba4705ae0e1a068f415ba6c69a7fd5bc (diff) | |
download | bcm5719-llvm-8d8de422dd787535df26890e3e7c9e3aa8f63cfe.tar.gz bcm5719-llvm-8d8de422dd787535df26890e3e7c9e3aa8f63cfe.zip |
Add options to disable simplification with passes, in case one of them crashes
llvm-svn: 5950
Diffstat (limited to 'llvm/tools/bugpoint/ExtractFunction.cpp')
-rw-r--r-- | llvm/tools/bugpoint/ExtractFunction.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp index 5451888c4f3..452ddbc24d8 100644 --- a/llvm/tools/bugpoint/ExtractFunction.cpp +++ b/llvm/tools/bugpoint/ExtractFunction.cpp @@ -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 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I, // 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()); |