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 | 5413b68b1f59041a821287790dbc1ee2e272cf4e (patch) | |
tree | 2459575e7aef95b3bb18f476b2524a2872770b9a /lib/CodeGen/MachineTraceMetrics.h | |
parent | 6b951b25c35f739ee0a1b5a4615718220830817d (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineTraceMetrics.h')
-rw-r--r-- | lib/CodeGen/MachineTraceMetrics.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineTraceMetrics.h b/lib/CodeGen/MachineTraceMetrics.h index 4f39aca490..c5b86f31db 100644 --- a/lib/CodeGen/MachineTraceMetrics.h +++ b/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 |