diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-28 23:54:28 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-28 23:54:28 +0000 |
commit | 8b4c502098d8a8aee52f2251db5614d9d26c83e2 (patch) | |
tree | d951e7eb1aa629ec8df161d6a0761141ab864c38 | |
parent | 78811669d5872b28c447ea9f7cfc3963c7f72841 (diff) | |
download | external_llvm-8b4c502098d8a8aee52f2251db5614d9d26c83e2.zip external_llvm-8b4c502098d8a8aee52f2251db5614d9d26c83e2.tar.gz external_llvm-8b4c502098d8a8aee52f2251db5614d9d26c83e2.tar.bz2 |
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
-rw-r--r-- | include/llvm/CodeGen/Passes.h | 5 | ||||
-rw-r--r-- | lib/CodeGen/Passes.cpp | 11 | ||||
-rw-r--r-- | lib/Target/PTX/PTXTargetMachine.cpp | 4 |
3 files changed, 5 insertions, 15 deletions
diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h index d6ca148e..3b38199 100644 --- a/include/llvm/CodeGen/Passes.h +++ b/include/llvm/CodeGen/Passes.h @@ -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. /// diff --git a/lib/CodeGen/Passes.cpp b/lib/CodeGen/Passes.cpp index 4a25af0..53d1fcf 100644 --- a/lib/CodeGen/Passes.cpp +++ b/lib/CodeGen/Passes.cpp @@ -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."); } } diff --git a/lib/Target/PTX/PTXTargetMachine.cpp b/lib/Target/PTX/PTXTargetMachine.cpp index 57bbe0b..c55a658 100644 --- a/lib/Target/PTX/PTXTargetMachine.cpp +++ b/lib/Target/PTX/PTXTargetMachine.cpp @@ -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() { |