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

75 Commits

Author SHA1 Message Date
Evan Cheng
7a6b20df7f Let callers decide the sub-register index on the def operand of rematerialized instructions.
Avoid remat'ing instructions whose def have sub-register indices for now. It's just really really hard to get all the cases right.

llvm-svn: 75900
2009-07-16 09:20:10 +00:00
Torok Edwin
67153904ec Fix assert(0) conversion, as suggested by Chris.
llvm-svn: 75423
2009-07-12 20:07:01 +00:00
Torok Edwin
9b41a5faf2 Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
and abort()/exit() -> llvm_report_error().

llvm-svn: 75363
2009-07-11 13:10:19 +00:00
Lang Hames
ceb80b14d3 Improved tracking of value number kills. VN kills are now represented
as an (index,bool) pair. The bool flag records whether the kill is a
PHI kill or not. This code will be used to enable splitting of live
intervals containing PHI-kills.

A slight change to live interval weights introduced an extra spill
into lsr-code-insertion (outside the critical sections). The test 
condition has been updated to reflect this.

llvm-svn: 75097
2009-07-09 03:57:02 +00:00
Lang Hames
5c64015a56 VNInfo cleanup.
llvm-svn: 73634
2009-06-17 21:01:20 +00:00
Evan Cheng
28aa6c41d1 In some rare cases, the register allocator can spill registers but end up not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However, reloads and restores might be folded into uses / defs and freed registers might not be used at all.
VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants.

Not yet enabled. This is part 1. More coming.

llvm-svn: 70787
2009-05-03 18:32:42 +00:00
Bob Wilson
c53238dff1 Fix pr3954. The register scavenger asserts for inline assembly with
register destinations that are tied to source operands.  The
TargetInstrDescr::findTiedToSrcOperand method silently fails for inline
assembly.  The existing MachineInstr::isRegReDefinedByTwoAddr was very
close to doing what is needed, so this revision makes a few changes to
that method and also renames it to isRegTiedToUseOperand (for consistency
with the very similar isRegTiedToDefOperand and because it handles both
two-address instructions and inline assembly with tied registers).

llvm-svn: 68714
2009-04-09 17:16:43 +00:00
Owen Anderson
59cff6919d Remove the "fast" cases for spill and restore point determination, as these were subtlely wrong in obscure cases. Patch the testcase
to account for this change.

llvm-svn: 68093
2009-03-31 08:27:09 +00:00
Owen Anderson
2648d3fad8 Give the pre-alloc splitter access to the VirtRegMap. It doesn't do anything
useful with it at the moment, but it will in the future.

llvm-svn: 67012
2009-03-14 21:40:05 +00:00
Owen Anderson
39e5f053c4 (Hopefully) silence a warning.
llvm-svn: 66158
2009-03-05 08:23:20 +00:00
Owen Anderson
744e33c12b Be more careful about choosing restore points when doing restore folding. This fixes some subtle miscompilations.
llvm-svn: 66147
2009-03-05 07:19:18 +00:00
Owen Anderson
fb7f64ea0d Add a restore folder, which shaves a dozen or so machineinstrs off oggenc. Update a testcase to check this.
llvm-svn: 66029
2009-03-04 08:52:31 +00:00
Owen Anderson
8d12de1c25 Fix a crash in the pre-alloc splitter exposed by recent codegen changes.
llvm-svn: 65121
2009-02-20 10:02:23 +00:00
Evan Cheng
381b2df5ff Add TargetInstrInfo::isSafeToMoveRegisterClassDefs. It returns true if it's safe to move an instruction which defines a value in the register class. Replace pre-splitting specific IgnoreRegisterClassBarriers with this new hook.
llvm-svn: 63936
2009-02-06 17:17:30 +00:00
Owen Anderson
902d570061 Pre-alloc splitting needs to be more careful to avoid inserting spills/restores
between call frame setup/restore points.  Unfortunately, this regresses 
code size a bit, but at least it's correct now!

llvm-svn: 63837
2009-02-05 05:58:41 +00:00
Owen Anderson
9d2293f7ad MergeValueInto is too smart: it might choose to do the merge the opposite direction.
Live interval reconstruction needs to account for this, and scour its maps to
prevent dangling references.

llvm-svn: 63558
2009-02-02 22:42:01 +00:00
Evan Cheng
95c4b28646 Refactor PerformPHIConstruction, no functionality changes.
llvm-svn: 63536
2009-02-02 18:33:18 +00:00
Owen Anderson
e7080fe2a9 Fix test failures causes by my previous commit.
llvm-svn: 63492
2009-02-01 08:41:54 +00:00
Owen Anderson
f403ec470e Fix an issue in PHI construction that was exposed by GCC 4.2 producing a different set iteration order for the reg_iterator.
llvm-svn: 63490
2009-02-01 07:06:00 +00:00
Owen Anderson
658fb62263 Correct the algorithms for choosing spill and restore points so that we don't try to insert loads/stores between call frame setup and the actual call.
This fixes the last known failure for the pre-alloc-splitter.

llvm-svn: 63339
2009-01-29 22:13:06 +00:00
Owen Anderson
4dfa70d703 Fix an issue where restores could be inserted after a terminator instruction,
and an iterator invalidation issue.

FreeBench/pifft no longer miscompiles with these fixes!

llvm-svn: 63293
2009-01-29 08:22:06 +00:00
Owen Anderson
ad49be6552 Comments are good. :-)
llvm-svn: 63276
2009-01-29 05:41:02 +00:00
Owen Anderson
607c1ea284 Add support for aggressive load-use-store folding. This takes care of the
vast majority of code size regressions introduced by pre-alloc-splitting.

llvm-svn: 63274
2009-01-29 05:28:55 +00:00
Owen Anderson
284f6dec01 Make the pre-split-limit option more useful by using a per-function counter.
llvm-svn: 63091
2009-01-27 05:01:15 +00:00
Owen Anderson
251512bd29 Reapply r63025 and r63026, with fixes for the failing testcases.
llvm-svn: 63049
2009-01-26 21:57:31 +00:00
Bill Wendling
3bf060ee33 Also revert r63206
llvm-svn: 63041
2009-01-26 21:30:17 +00:00
Bill Wendling
3cf6d13f21 Temporarily revert r63025 until the testsuite failures can be fixed.
llvm-svn: 63040
2009-01-26 21:27:03 +00:00
Owen Anderson
9bcbf6b882 Get rid of a bunch of dead code now that interval reconstruction is enabled.
llvm-svn: 63026
2009-01-26 19:18:06 +00:00
Owen Anderson
834f011a63 Fix an issue where LiveIntervals was trying to be smart about removing kill
markers, and ended up foiling the interval reconstruction.

This allows us to turn on reconstruction in the pre alloc splitter, which
fixes a number of miscompilations.

llvm-svn: 63025
2009-01-26 19:12:06 +00:00
Evan Cheng
cdf60c96c8 Silence a bogus compiler warning.
llvm-svn: 63021
2009-01-26 18:33:51 +00:00
Owen Anderson
78b6a961bb Some cleanups. No functional changes.
llvm-svn: 62917
2009-01-24 10:07:43 +00:00
Owen Anderson
8c41157459 Stage two of fixing pre-alloc-splitting's code size issues: filter out restores that are just
going to be re-spilled again.

This also helps performance.  Pre-alloc-splitting now seems to be an overall win on SPEC.

llvm-svn: 62834
2009-01-23 03:28:53 +00:00
Owen Anderson
b9426381f3 Add an initial pass at dead spill/restore removal for pre alloc splitting.
llvm-svn: 62821
2009-01-23 00:23:32 +00:00
Owen Anderson
d1a2413f88 I accidentally removed this check in an earlier commit, which cause breakage in the pre alloc splitter.
llvm-svn: 62678
2009-01-21 08:18:03 +00:00
Owen Anderson
10ad717dc8 Be more aggressive about renumbering vregs after splitting them.
llvm-svn: 62639
2009-01-21 00:13:28 +00:00
Evan Cheng
b3c82db63d Change TargetInstrInfo::isMoveInstr to return source and destination sub-register indices as well.
llvm-svn: 62600
2009-01-20 19:12:24 +00:00
Owen Anderson
e6451daef4 More two-address fixes. This gets lua working with join-creation enabled.
llvm-svn: 62073
2009-01-12 03:10:40 +00:00
Owen Anderson
1f1e4ab65a The phi construction algorithm used for interval reconstruction is complicated by
two address instructions.  We need to keep track of things we've processed AS USES
independetly of whether we've processed them as defs.

This fixes all known miscompilations when reconstruction is turned on.

llvm-svn: 61802
2009-01-06 07:53:32 +00:00
Owen Anderson
28649f1598 Get rid of sentinel insertion in interval reconstruction. It just masked the
problem, rather than fixing it.  The problem has now been fixed the right way.

llvm-svn: 61723
2009-01-05 18:32:26 +00:00
Owen Anderson
ccde9db05a Get live interval reconstruction several steps closer to working.
llvm-svn: 61514
2008-12-31 02:00:25 +00:00
Duncan Sands
ef77539014 Add braces, as suggested by a gcc warning.
llvm-svn: 61465
2008-12-29 08:05:02 +00:00
Owen Anderson
e5b1fb3c25 Fix up kill/dead marking in the new live interval reconstruction code.
llvm-svn: 61460
2008-12-28 23:35:13 +00:00
Owen Anderson
e21f8339f8 Add prototype code for recomputing a live interval's ranges and valnos through recursive phi construction.
llvm-svn: 61458
2008-12-28 21:48:48 +00:00
Owen Anderson
9a489bf18a Re-apply r61158 in a form that no longer breaks tests.
llvm-svn: 61182
2008-12-18 01:27:19 +00:00
Owen Anderson
5f1bc95673 Revert r61158 for now, as it caused some test failures.
llvm-svn: 61159
2008-12-17 22:17:27 +00:00
Owen Anderson
446162d848 Fix miscompilations caused by renumbering, and enable it as part of prealloc splitting.
llvm-svn: 61158
2008-12-17 22:06:59 +00:00
Owen Anderson
36aba82416 Add code to renumber split intervals into new vregs. This is disabled for now until I finish working out some iterator invalidation issues.
llvm-svn: 61104
2008-12-16 21:35:08 +00:00
Owen Anderson
a5f2ce1ee3 Switch to top-down mode and fix a crasher this exposed caused by an error in the
live interval updating.

llvm-svn: 60652
2008-12-07 05:33:18 +00:00
Owen Anderson
9e2293bda3 Factor out some common code.
llvm-svn: 60553
2008-12-04 21:20:30 +00:00
Owen Anderson
afbd11e227 Add support for folding spills into preceding defs when doing pre-alloc splitting.
llvm-svn: 60433
2008-12-02 18:53:47 +00:00