Run the verifier after LSR, to help catch use-before-def errors before

they reach codegen.

llvm-svn: 94066
This commit is contained in:
Dan Gohman 2010-01-21 03:51:36 +00:00
parent 87f2f9b465
commit 55a365e797
1 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/PassManager.h"
#include "llvm/Pass.h"
#include "llvm/Analysis/Verifier.h"
#include "llvm/Assembly/PrintModulePass.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/Passes.h"
@ -282,6 +283,9 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
PM.add(createLoopStrengthReducePass(getTargetLowering()));
if (PrintLSR)
PM.add(createPrintFunctionPass("\n\n*** Code after LSR ***\n", &dbgs()));
#ifndef NDEBUG
PM.add(createVerifierPass());
#endif
}
// Turn exception handling constructs into something the code generators can