Add MachineTraceMetrics::verify().

This function verifies the consistency of cached data in the
MachineTraceMetrics analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160976 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2012-07-30 18:34:11 +00:00
parent ee31ae12e8
commit a1b2bf7979
3 changed files with 55 additions and 11 deletions

View File

@@ -61,6 +61,7 @@ class MachineLoop;
class raw_ostream;
class MachineTraceMetrics : public MachineFunctionPass {
const MachineFunction *MF;
const TargetInstrInfo *TII;
const TargetRegisterInfo *TRI;
const MachineRegisterInfo *MRI;
@@ -178,7 +179,7 @@ public:
virtual const MachineBasicBlock *pickTracePred(const MachineBasicBlock*) =0;
virtual const MachineBasicBlock *pickTraceSucc(const MachineBasicBlock*) =0;
explicit Ensemble(MachineTraceMetrics*);
MachineLoop *getLoopFor(const MachineBasicBlock*);
const MachineLoop *getLoopFor(const MachineBasicBlock*) const;
const TraceBlockInfo *getDepthResources(const MachineBasicBlock*) const;
const TraceBlockInfo *getHeightResources(const MachineBasicBlock*) const;
@@ -187,6 +188,7 @@ public:
virtual const char *getName() const =0;
void print(raw_ostream&) const;
void invalidate(const MachineBasicBlock *MBB);
void verify() const;
/// Get the trace that passes through MBB.
/// The trace is computed on demand.
@@ -210,6 +212,10 @@ 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<FixedBlockInfo, 4> BlockInfo;