summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineTraceMetrics.h
Commit message (Collapse)AuthorAgeFilesLines
* Don't crash on extra evil irreducible control flow.Jakob Stoklund Olesen2012-10-081-0/+8
| | | | | | | | | | | | | | When the CFG contains a loop with multiple entry blocks, the traces computed by MachineTraceMetrics don't always have the same nice properties. Loop back-edges are normally excluded from traces, but MachineLoopInfo doesn't recognize loops with multiple entry blocks, so those back-edges may be included. Avoid asserting when that happens by adding an isEarlierInSameTrace() function that accurately determines if a dominating block is part of the same trace AND is above the currrent block in the trace. llvm-svn: 165434
* Switch MachineTraceMetrics to the new TargetSchedModel interface.Jakob Stoklund Olesen2012-10-041-1/+2
| | | | llvm-svn: 165235
* Add more trace query functions.Jakob Stoklund Olesen2012-08-101-0/+13
| | | | | | | | | | | 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
* Fix a couple of typos.Jakob Stoklund Olesen2012-08-071-1/+1
| | | | llvm-svn: 161437
* Add trace accessor methods, implement primitive if-conversion heuristic.Jakob Stoklund Olesen2012-08-071-11/+36
| | | | | | | | Compare the critical paths of the two traces through an if-conversion candidate. If the difference is larger than the branch brediction penalty, reject the if-conversion. If would never pay. llvm-svn: 161433
* Compute the critical path length through a trace.Jakob Stoklund Olesen2012-08-021-0/+6
| | | | | | | | | | | Whenever both instruction depths and instruction heights are known in a block, it is possible to compute the length of the critical path as max(depth+height) over the instructions in the block. The stored live-in lists make it possible to accurately compute the length of a critical path that bypasses the current (small) block. llvm-svn: 161197
* Compute instruction heights through a trace.Jakob Stoklund Olesen2012-08-011-1/+22
| | | | | | | | | | | | | | | | | | | The height on an instruction is the minimum number of cycles from the instruction is issued to the end of the trace. Heights are computed for all instructions in and below the trace center block. The method for computing heights is different from the depth computation. As we visit instructions in the trace bottom-up, heights of used instructions are pushed upwards. This way, we avoid scanning long use lists, looking for uses in the current trace. At each basic block boundary, a list of live-in registers and their minimum heights is saved in the trace block info. These live-in lists are used when restarting depth computations on a trace that converges with an already computed trace. They will also be used to accurately compute the critical path length. llvm-svn: 161138
* Compute instruction depths through the current trace.Jakob Stoklund Olesen2012-07-311-7/+40
| | | | | | | | | | | Assuming infinite issue width, compute the earliest each instruction in the trace can issue, when considering the latency of data dependencies. The issue cycle is record as a 'depth' from the beginning of the trace. This is half the computation required to find the length of the critical path through the trace. Heights are next. llvm-svn: 161074
* Rename CT -> MTM. MachineTraceMetrics is abbreviated MTM.Jakob Stoklund Olesen2012-07-311-1/+1
| | | | llvm-svn: 161072
* Clarify invalidation strategy in comment.Jakob Stoklund Olesen2012-07-301-0/+6
| | | | llvm-svn: 160997
* Hook into PassManager's analysis verification.Jakob Stoklund Olesen2012-07-301-4/+1
| | | | | | | By overriding Pass::verifyAnalysis(), the pass contents will be verified by the pass manager. llvm-svn: 160994
* Add MachineTraceMetrics::verify().Jakob Stoklund Olesen2012-07-301-1/+7
| | | | | | | This function verifies the consistency of cached data in the MachineTraceMetrics analysis. llvm-svn: 160976
* Add more debug output to MachineTraceMetrics.Jakob Stoklund Olesen2012-07-271-1/+11
| | | | llvm-svn: 160905
* Keep track of the head and tail of the trace through each block.Jakob Stoklund Olesen2012-07-271-0/+6
| | | | | | | This makes it possible to quickly detect blocks that are outside the trace. llvm-svn: 160904
* Start scaffolding for a MachineTraceMetrics analysis pass.Jakob Stoklund Olesen2012-07-261-0/+218
This is still a work in progress. Out-of-order CPUs usually execute instructions from multiple basic blocks simultaneously, so it is necessary to look at longer traces when estimating the performance effects of code transformations. The MachineTraceMetrics analysis will pick a typical trace through a given basic block and provide performance metrics for the trace. Metrics will include: - Instruction count through the trace. - Issue count per functional unit. - Critical path length, and per-instruction 'slack'. These metrics can be used to determine the performance limiting factor when executing the trace, and how it will be affected by a code transformation. Initially, this will be used by the early if-conversion pass. llvm-svn: 160796
OpenPOWER on IntegriCloud