From: Jakob Stoklund Olesen Date: Mon, 30 Jul 2012 20:57:50 +0000 (+0000) Subject: Hook into PassManager's analysis verification. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ef6c76c984f821ea866902a7f9e695b16e971468;p=oota-llvm.git Hook into PassManager's analysis verification. By overriding Pass::verifyAnalysis(), the pass contents will be verified by the pass manager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160994 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/EarlyIfConversion.cpp b/lib/CodeGen/EarlyIfConversion.cpp index f5cf107de7e..e49b9d3e18e 100644 --- a/lib/CodeGen/EarlyIfConversion.cpp +++ b/lib/CodeGen/EarlyIfConversion.cpp @@ -586,13 +586,13 @@ void EarlyIfConverter::updateLoops(ArrayRef Removed) { /// Invalidate MachineTraceMetrics before if-conversion. void EarlyIfConverter::invalidateTraces() { - Traces->verify(); + Traces->verifyAnalysis(); Traces->invalidate(IfConv.Head); Traces->invalidate(IfConv.Tail); Traces->invalidate(IfConv.TBB); Traces->invalidate(IfConv.FBB); DEBUG(if (MinInstr) MinInstr->print(dbgs())); - Traces->verify(); + Traces->verifyAnalysis(); } /// Apply cost model and heuristics to the if-conversion in IfConv. diff --git a/lib/CodeGen/MachineTraceMetrics.cpp b/lib/CodeGen/MachineTraceMetrics.cpp index cf0d9c64412..c31e6bd92a9 100644 --- a/lib/CodeGen/MachineTraceMetrics.cpp +++ b/lib/CodeGen/MachineTraceMetrics.cpp @@ -284,7 +284,7 @@ void MachineTraceMetrics::invalidate(const MachineBasicBlock *MBB) { Ensembles[i]->invalidate(MBB); } -void MachineTraceMetrics::verify() const { +void MachineTraceMetrics::verifyAnalysis() const { #ifndef NDEBUG assert(BlockInfo.size() == MF->getNumBlockIDs() && "Outdated BlockInfo size"); for (unsigned i = 0; i != TS_NumStrategies; ++i) diff --git a/lib/CodeGen/MachineTraceMetrics.h b/lib/CodeGen/MachineTraceMetrics.h index fa4970a07c8..56ea74ea85f 100644 --- a/lib/CodeGen/MachineTraceMetrics.h +++ b/lib/CodeGen/MachineTraceMetrics.h @@ -75,6 +75,7 @@ public: void getAnalysisUsage(AnalysisUsage&) const; bool runOnMachineFunction(MachineFunction&); void releaseMemory(); + void verifyAnalysis() const; friend class Ensemble; friend class Trace; @@ -212,10 +213,6 @@ public: /// is erased, or the CFG is otherwise changed. void invalidate(const MachineBasicBlock *MBB); - /// Verify the internal consistency of cached data. - /// This does nothing in NDEBUG builds. - void verify() const; - private: // One entry per basic block, indexed by block number. SmallVector BlockInfo;