Enable machine code verification in the entire code generator.

Some targets still mess up the liveness information, but that isn't
verified after MRI->invalidateLiveness().

The verifier can still check other useful things like register classes
and CFG, so it should be enabled after all passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2012-03-28 23:54:28 +00:00
parent 78811669d5
commit 8b4c502098
3 changed files with 5 additions and 15 deletions

View File

@ -223,11 +223,6 @@ protected:
/// regalloc pass.
FunctionPass *createRegAllocPass(bool Optimized);
/// printNoVerify - Add a pass to dump the machine function, if debugging is
/// enabled.
///
void printNoVerify(const char *Banner) const;
/// printAndVerify - Add a pass to dump then verify the machine function, if
/// those steps are enabled.
///

View File

@ -272,11 +272,6 @@ AnalysisID TargetPassConfig::addPass(char &ID) {
return FinalID;
}
void TargetPassConfig::printNoVerify(const char *Banner) const {
if (TM->shouldPrintMachineCode())
PM.add(createMachineFunctionPrinterPass(dbgs(), Banner));
}
void TargetPassConfig::printAndVerify(const char *Banner) const {
if (TM->shouldPrintMachineCode())
PM.add(createMachineFunctionPrinterPass(dbgs(), Banner));
@ -403,7 +398,7 @@ void TargetPassConfig::addMachinePasses() {
// Second pass scheduler.
if (getOptLevel() != CodeGenOpt::None) {
addPass(PostRASchedulerID);
printNoVerify("After PostRAScheduler");
printAndVerify("After PostRAScheduler");
}
// GC
@ -416,7 +411,7 @@ void TargetPassConfig::addMachinePasses() {
addBlockPlacement();
if (addPreEmitPass())
printNoVerify("After PreEmit passes");
printAndVerify("After PreEmit passes");
}
/// Add passes that optimize machine instructions in SSA form.
@ -628,6 +623,6 @@ void TargetPassConfig::addBlockPlacement() {
if (EnableBlockPlacementStats)
addPass(MachineBlockPlacementStatsID);
printNoVerify("After machine block placement.");
printAndVerify("After machine block placement.");
}
}

View File

@ -152,10 +152,10 @@ bool PTXPassConfig::addPostRegAlloc() {
/// Add passes that optimize machine instructions after register allocation.
void PTXPassConfig::addMachineLateOptimization() {
if (addPass(BranchFolderPassID) != &NoPassID)
printNoVerify("After BranchFolding");
printAndVerify("After BranchFolding");
if (addPass(TailDuplicateID) != &NoPassID)
printNoVerify("After TailDuplicate");
printAndVerify("After TailDuplicate");
}
bool PTXPassConfig::addPreEmitPass() {