mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Add options to disable simplification with passes, in case one of them crashes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5950 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8bdd129c8a
commit
6db70ef879
@ -14,6 +14,19 @@
|
|||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/Constant.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
|
/// deleteInstructionFromProgram - This method clones the current Program and
|
||||||
/// deletes the specified instruction from the cloned module. It then runs a
|
/// 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.
|
// Spiff up the output a little bit.
|
||||||
PassManager Passes;
|
PassManager Passes;
|
||||||
if (Simplification > 2)
|
if (Simplification > 2 && !NoADCE)
|
||||||
Passes.add(createAggressiveDCEPass()); // Remove dead code...
|
Passes.add(createAggressiveDCEPass()); // Remove dead code...
|
||||||
//Passes.add(createInstructionCombiningPass());
|
//Passes.add(createInstructionCombiningPass());
|
||||||
if (Simplification > 1)
|
if (Simplification > 1 && !NoDCE)
|
||||||
Passes.add(createDeadCodeEliminationPass());
|
Passes.add(createDeadCodeEliminationPass());
|
||||||
if (Simplification)
|
if (Simplification && !NoSCFG)
|
||||||
Passes.add(createCFGSimplificationPass()); // Delete dead control flow
|
Passes.add(createCFGSimplificationPass()); // Delete dead control flow
|
||||||
|
|
||||||
Passes.add(createVerifierPass());
|
Passes.add(createVerifierPass());
|
||||||
|
Loading…
Reference in New Issue
Block a user