aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-05 15:51:05 +0000
committerChris Lattner <sabre@nondot.org>2003-08-05 15:51:05 +0000
commit47ae4a1cee5eec5767a11403c0fac7c91ec45461 (patch)
tree38f1a6afc1b5dee49498bc70130e54deeb15949e /tools
parent7a012299ced5cff02cec47055a63d3b2a78bb36f (diff)
downloadexternal_llvm-47ae4a1cee5eec5767a11403c0fac7c91ec45461.zip
external_llvm-47ae4a1cee5eec5767a11403c0fac7c91ec45461.tar.gz
external_llvm-47ae4a1cee5eec5767a11403c0fac7c91ec45461.tar.bz2
If we're debugging the SimplifyCFG pass, we _REALLY_ don't want to use it for
narrowing, no matter what. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7596 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/bugpoint/BugDriver.h2
-rw-r--r--tools/bugpoint/CrashDebugger.cpp12
-rw-r--r--tools/bugpoint/ExtractFunction.cpp8
3 files changed, 14 insertions, 8 deletions
diff --git a/tools/bugpoint/BugDriver.h b/tools/bugpoint/BugDriver.h
index f86782a..eff11ec 100644
--- a/tools/bugpoint/BugDriver.h
+++ b/tools/bugpoint/BugDriver.h
@@ -27,6 +27,8 @@ class ReduceCrashingBlocks;
class CBE;
class GCC;
+extern bool DisableSimplifyCFG;
+
class BugDriver {
const std::string ToolName; // Name of bugpoint
std::string ReferenceOutputFile; // Name of `good' output file
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp
index 8727255..e969d5e 100644
--- a/tools/bugpoint/CrashDebugger.cpp
+++ b/tools/bugpoint/CrashDebugger.cpp
@@ -304,11 +304,13 @@ bool BugDriver::debugCrash() {
// 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!
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index 525c746..9cb922a 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -16,6 +16,8 @@
#include "llvm/Constant.h"
#include "Support/CommandLine.h"
+bool DisableSimplifyCFG = false;
+
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>
- 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",
@@ -67,7 +69,7 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I,
//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());