1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

18 Commits

Author SHA1 Message Date
David Blaikie
a00a3562bd Tidy up a few more uses of MF.getFunction()->getName().
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).

llvm-svn: 162367
2012-08-22 17:18:53 +00:00
Jakob Stoklund Olesen
343ed1017e Count triangles and diamonds in early if-conversion.
llvm-svn: 161783
2012-08-13 21:03:27 +00:00
Jakob Stoklund Olesen
0e46305efe Delete dead typedef.
llvm-svn: 161782
2012-08-13 21:03:25 +00:00
Jakob Stoklund Olesen
8e6595639e Handle extra Tail predecessors in if-conversion.
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.

llvm-svn: 161781
2012-08-13 20:49:04 +00:00
Jakob Stoklund Olesen
887e16b508 Add a proper if-conversion cost model.
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.

llvm-svn: 161713
2012-08-10 22:27:31 +00:00
Jakob Stoklund Olesen
43da54d467 Add getTPred() and getFPred() functions.
They identify the PHI predecessors in both diamonds and triangles.

llvm-svn: 161689
2012-08-10 20:19:17 +00:00
Jakob Stoklund Olesen
83cdb2bdf4 Heed -stress-early-ifcvt.
llvm-svn: 161513
2012-08-08 18:24:23 +00:00
Jakob Stoklund Olesen
57743948ca Get the MispredictPenalty from MCSchedModel.
Thanks, Andy!

llvm-svn: 161507
2012-08-08 18:19:58 +00:00
Jakob Stoklund Olesen
438bc30c3d Add trace accessor methods, implement primitive if-conversion heuristic.
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
2012-08-07 18:02:19 +00:00
Jakob Stoklund Olesen
d91215215c Hook into PassManager's analysis verification.
By overriding Pass::verifyAnalysis(), the pass contents will be verified
by the pass manager.

llvm-svn: 160994
2012-07-30 20:57:50 +00:00
Jakob Stoklund Olesen
c3b8765d57 Add MachineTraceMetrics::verify().
This function verifies the consistency of cached data in the
MachineTraceMetrics analysis.

llvm-svn: 160976
2012-07-30 18:34:11 +00:00
Jakob Stoklund Olesen
0eacb18967 Add more debug output to MachineTraceMetrics.
llvm-svn: 160905
2012-07-27 23:58:38 +00:00
Jakob Stoklund Olesen
0d3c0a9aea Start scaffolding for a MachineTraceMetrics analysis pass.
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
2012-07-26 18:38:11 +00:00
Jakob Stoklund Olesen
55790859d7 Require and preserve LoopInfo for early if-conversion.
It will surely be needed by heuristics.

llvm-svn: 160027
2012-07-10 22:39:56 +00:00
Jakob Stoklund Olesen
2cdac0c7af Run early if-conversion in domtree post-order.
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.

llvm-svn: 160025
2012-07-10 22:18:23 +00:00
Jakob Stoklund Olesen
8f9719a55e Add some comments suggested in code review.
llvm-svn: 159800
2012-07-06 02:31:22 +00:00
Matt Beaumont-Gay
723207e88f Fix some ascii art in a comment to not have trailing backslashes (inspiration
from IfConversion.cc), and fix some spelling and grammar in the surrounding
prose.

llvm-svn: 159699
2012-07-04 01:09:45 +00:00
Jakob Stoklund Olesen
db187a51eb Add an experimental early if-conversion pass, off by default.
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.

llvm-svn: 159694
2012-07-04 00:09:54 +00:00