diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-10 22:27:27 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-10 22:27:27 +0000 |
commit | 3484420927b32c0e5238bc307562334f58eadfa0 (patch) | |
tree | f73057603cbc191da3b6867d1b011498f80dff79 /llvm/lib/CodeGen/MachineTraceMetrics.h | |
parent | 02e5309b3502082399f0c5f616f7ce3f8ee57f28 (diff) | |
download | bcm5719-llvm-3484420927b32c0e5238bc307562334f58eadfa0.tar.gz bcm5719-llvm-3484420927b32c0e5238bc307562334f58eadfa0.zip |
Add more trace query functions.
Trace::getResourceLength() computes the number of cycles required to
execute the trace when ignoring data dependencies. The number can be
compared to the critical path to estimate the trace ILP.
Trace::getPHIDepth() computes the data dependency depth of a PHI in a
trace successor that isn't necessarily part of the trace.
llvm-svn: 161711
Diffstat (limited to 'llvm/lib/CodeGen/MachineTraceMetrics.h')
-rw-r--r-- | llvm/lib/CodeGen/MachineTraceMetrics.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineTraceMetrics.h b/llvm/lib/CodeGen/MachineTraceMetrics.h index 4f39aca490c..c5b86f31dba 100644 --- a/llvm/lib/CodeGen/MachineTraceMetrics.h +++ b/llvm/lib/CodeGen/MachineTraceMetrics.h @@ -226,6 +226,15 @@ public: /// When Bottom is set, instructions in the trace center block are included. unsigned getResourceDepth(bool Bottom) const; + /// Return the resource length of the trace. This is the number of cycles + /// required to execute the instructions in the trace if they were all + /// independent, exposing the maximum instruction-level parallelism. + /// + /// Any blocks in Extrablocks are included as if they were part of the + /// trace. + unsigned getResourceLength(ArrayRef<const MachineBasicBlock*> Extrablocks = + ArrayRef<const MachineBasicBlock*>()) const; + /// Return the length of the (data dependency) critical path through the /// trace. unsigned getCriticalPath() const { return TBI.CriticalPath; } @@ -241,6 +250,10 @@ public: /// before the critical path becomes longer. /// MI must be an instruction in the trace center block. unsigned getInstrSlack(const MachineInstr *MI) const; + + /// Return the Depth of a PHI instruction in a trace center block successor. + /// The PHI does not have to be part of the trace. + unsigned getPHIDepth(const MachineInstr *PHI) const; }; /// A trace ensemble is a collection of traces selected using the same |