summaryrefslogtreecommitdiff
path: root/lib/CodeGen/EarlyIfConversion.cpp
Commit message (Collapse)AuthorAge
* Stop running the machine code verifier unconditionally.Jakob Stoklund Olesen2012-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166646 91177308-0d34-0410-b5e6-96231b3b80d8
* Get MCSchedModel directly from the subtarget.Jakob Stoklund Olesen2012-10-04
| | | | | | | Not all targets have itineraries, but the subtarget always has an MCSchedModel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165236 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up a few more uses of MF.getFunction()->getName().David Blaikie2012-08-22
| | | | | | | | Based on CR feedback from r162301 and Craig Topper's refactoring in r162347 here are a few other places that could use the same API (& in one instance drop a Function.h dependency). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162367 91177308-0d34-0410-b5e6-96231b3b80d8
* Count triangles and diamonds in early if-conversion.Jakob Stoklund Olesen2012-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161783 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete dead typedef.Jakob Stoklund Olesen2012-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161782 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle extra Tail predecessors in if-conversion.Jakob Stoklund Olesen2012-08-13
| | | | | | | | It is still possible to if-convert if the tail block has extra predecessors, but the tail phis must be rewritten instead of being removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161781 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a proper if-conversion cost model.Jakob Stoklund Olesen2012-08-10
| | | | | | | | | | | | | | Detect when there is not enough available ILP, so if-conversion can't speculate instructions for free. Compute the lengthening of the critical path when inserting a select instruction that depends on the condition as well as both sides of the if. Reject conversions that would stretch the critical path by more than half a mispredict penalty. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161713 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getTPred() and getFPred() functions.Jakob Stoklund Olesen2012-08-10
| | | | | | They identify the PHI predecessors in both diamonds and triangles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161689 91177308-0d34-0410-b5e6-96231b3b80d8
* Heed -stress-early-ifcvt.Jakob Stoklund Olesen2012-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161513 91177308-0d34-0410-b5e6-96231b3b80d8
* Get the MispredictPenalty from MCSchedModel.Jakob Stoklund Olesen2012-08-08
| | | | | | Thanks, Andy! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161507 91177308-0d34-0410-b5e6-96231b3b80d8
* Add trace accessor methods, implement primitive if-conversion heuristic.Jakob Stoklund Olesen2012-08-07
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161433 91177308-0d34-0410-b5e6-96231b3b80d8
* Hook into PassManager's analysis verification.Jakob Stoklund Olesen2012-07-30
| | | | | | | 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
* Add MachineTraceMetrics::verify().Jakob Stoklund Olesen2012-07-30
| | | | | | | 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
* Add more debug output to MachineTraceMetrics.Jakob Stoklund Olesen2012-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160905 91177308-0d34-0410-b5e6-96231b3b80d8
* Start scaffolding for a MachineTraceMetrics analysis pass.Jakob Stoklund Olesen2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160796 91177308-0d34-0410-b5e6-96231b3b80d8
* Require and preserve LoopInfo for early if-conversion.Jakob Stoklund Olesen2012-07-10
| | | | | | It will surely be needed by heuristics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160027 91177308-0d34-0410-b5e6-96231b3b80d8
* Run early if-conversion in domtree post-order.Jakob Stoklund Olesen2012-07-10
| | | | | | | | | | | This ordering allows nested if-conversion without using a work list, and it makes it possible to update the dominator tree on the fly as well. Any erased basic blocks will always be dominated by the current post-order position, so the domtree can be pruned without invalidating the iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160025 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some comments suggested in code review.Jakob Stoklund Olesen2012-07-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159800 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some ascii art in a comment to not have trailing backslashes (inspirationMatt Beaumont-Gay2012-07-04
| | | | | | | from IfConversion.cc), and fix some spelling and grammar in the surrounding prose. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159699 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an experimental early if-conversion pass, off by default.Jakob Stoklund Olesen2012-07-04
This pass performs if-conversion on SSA form machine code by speculatively executing both sides of the branch and using a cmov instruction to select the result. This can help lower the number of branch mispredictions on architectures like x86 that don't have predicable instructions. The current implementation is very aggressive, and causes regressions on mosts tests. It needs good heuristics that have yet to be implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159694 91177308-0d34-0410-b5e6-96231b3b80d8