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

52 Commits

Author SHA1 Message Date
Bill Wendling
93556af6c4 Don't recalculate the loop info and loop dominators analyses if they're
preserved.

llvm-svn: 45596
2008-01-04 20:54:55 +00:00
Bill Wendling
4f3a9df125 80-column violations.
llvm-svn: 45574
2008-01-04 08:59:18 +00:00
Chris Lattner
de54e62962 update a couple of references to SSARegMap.
llvm-svn: 45468
2007-12-31 04:16:08 +00:00
Chris Lattner
96167aa93c Rename SSARegMap -> MachineRegisterInfo in keeping with the idea
that "machine" classes are used to represent the current state of
the code being compiled.  Given this expanded name, we can start 
moving other stuff into it.  For now, move the UsedPhysRegs and
LiveIn/LoveOuts vectors from MachineFunction into it.

Update all the clients to match.

This also reduces some needless #includes, such as MachineModuleInfo
from MachineFunction.

llvm-svn: 45467
2007-12-31 04:13:23 +00:00
Chris Lattner
7504adbd72 More cleanups for MachineOperand:
- Eliminate the static "print" method for operands, moving it
    into MachineOperand::print.
  - Change various set* methods for register flags to take a bool
    for the value to set it to.  Remove unset* methods.
  - Group methods more logically by operand flavor in MachineOperand.h

llvm-svn: 45461
2007-12-30 21:56:09 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Evan Cheng
d0bb7ee0a1 The physical register + virtual register joining requirement was much too strict.
llvm-svn: 45253
2007-12-20 02:23:25 +00:00
Evan Cheng
45c08c8337 Switch over to MachineLoopInfo.
llvm-svn: 44838
2007-12-11 02:09:15 +00:00
Evan Cheng
d9a07b1c9d Add an option to control this heuristic tweak so I can test it.
llvm-svn: 44671
2007-12-07 00:28:32 +00:00
Evan Cheng
1d289d0146 Fix for PR1831: if all defs of an interval are re-materializable, then it's a preferred spill candiate.
llvm-svn: 44644
2007-12-06 00:01:56 +00:00
Evan Cheng
72fe4454e6 Replace the odd kill# hack with something less fragile.
llvm-svn: 44434
2007-11-29 09:49:23 +00:00
Evan Cheng
5c96771102 Live interval splitting:
When a live interval is being spilled, rather than creating short, non-spillable
intervals for every def / use, split the interval at BB boundaries. That is, for
every BB where the live interval is defined or used, create a new interval that
covers all the defs and uses in the BB.

This is designed to eliminate one common problem: multiple reloads of the same
value in a single basic block. Note, it does *not* decrease the number of spills
since no copies are inserted so the split intervals are *connected* through
spill and reloads (or rematerialization). The newly created intervals can be
spilled again, in that case, since it does not span multiple basic blocks, it's
spilled in the usual manner. However, it can reuse the same stack slot as the
previously split interval.

This is currently controlled by -split-intervals-at-bb.

llvm-svn: 44198
2007-11-17 00:40:40 +00:00
Evan Cheng
fd33cb316f Clean up sub-register implementation by moving subReg information back to
MachineOperand auxInfo. Previous clunky implementation uses an external map
to track sub-register uses. That works because register allocator uses
a new virtual register for each spilled use. With interval splitting (coming
soon), we may have multiple uses of the same register some of which are
of using different sub-registers from others. It's too fragile to constantly
update the information.

llvm-svn: 44104
2007-11-14 07:59:08 +00:00
Evan Cheng
d887bfa88e Refactor some code.
llvm-svn: 44010
2007-11-12 06:35:08 +00:00
Evan Cheng
bd9a038bd7 First step towards moving the coalescer to priority_queue based machinery.
llvm-svn: 43764
2007-11-06 08:52:21 +00:00
Evan Cheng
ec35b58b0a Move SimpleRegisterCoalescing.h to lib/CodeGen since there is now a common
register coalescer interface: RegisterCoalescing.

llvm-svn: 43714
2007-11-05 17:41:38 +00:00
Evan Cheng
28c61e33a4 Skip over deleted val#'s.
llvm-svn: 43700
2007-11-05 06:46:45 +00:00
Evan Cheng
7c2d41dcc1 - Coalesce extract_subreg when both intervals are relatively small.
- Some code clean up.

llvm-svn: 43606
2007-11-01 06:22:48 +00:00
Evan Cheng
f6d1c7be14 Really fix PR1734. Carefully track which register uses are sub-register uses by
traversing inverse register coalescing map.

llvm-svn: 43118
2007-10-18 07:49:59 +00:00
Evan Cheng
18a3c3dd37 One more extract_subreg coalescing bug fix.
llvm-svn: 43065
2007-10-17 05:29:37 +00:00
Evan Cheng
09fa6ed483 Fix PR1734.
llvm-svn: 43035
2007-10-16 19:29:47 +00:00
Evan Cheng
69092e7585 Code clean up.
llvm-svn: 43026
2007-10-16 08:04:24 +00:00
Evan Cheng
43887d3714 Fix PR1729: watch out for val# with no def.
llvm-svn: 42996
2007-10-15 18:33:50 +00:00
Evan Cheng
62ee7cd439 When coalescing an EXTRACT_SUBREG and the dst register is a physical register,
the source register will be coalesced to the super register of the LHS. Properly
merge in the live ranges of the resulting coalesced interval that were part of
the original source interval to the live interval of the super-register.

llvm-svn: 42961
2007-10-14 10:08:34 +00:00
Evan Cheng
9beb8daf9c Restrict EXTRACT_SUBREG coalescing to avoid negative performance impact.
llvm-svn: 42903
2007-10-12 09:15:53 +00:00
Evan Cheng
d11cd4a095 EXTRACT_SUBREG coalescing support. The coalescer now treats EXTRACT_SUBREG like
(almost) a register copy. However, it always coalesced to the register of the
RHS (the super-register). All uses of the result of a EXTRACT_SUBREG are sub-
register uses which adds subtle complications to load folding, spiller rewrite,
etc.

llvm-svn: 42899
2007-10-12 08:50:34 +00:00
Evan Cheng
726b00c4dd Bad choice of variable name.
llvm-svn: 42821
2007-10-10 00:11:40 +00:00
Evan Cheng
f979e5b206 Fix an extremely stupid bug that prevented first round of coalescing (physical registers only) from happening.
llvm-svn: 42820
2007-10-09 23:36:27 +00:00
Dan Gohman
fb60c0dfed Remove isReg, isImm, and isMBB, and change all their users to use
isRegister, isImmediate, and isMachineBasicBlock, which are equivalent,
and more popular.

llvm-svn: 41958
2007-09-14 20:33:02 +00:00
David Greene
2ca4b270db Pluggable coalescers inplementation.
llvm-svn: 41743
2007-09-06 16:18:45 +00:00
Evan Cheng
3bda699975 Use pool allocator for all the VNInfo's to improve memory access locality. This reduces coalescing time on siod Mac OS X PPC by 35%. Also remove the back ptr from VNInfo to LiveInterval and other tweaks.
llvm-svn: 41729
2007-09-05 21:46:51 +00:00
Evan Cheng
25c46702da More tweaks to improve compile time.
llvm-svn: 41669
2007-09-01 02:03:17 +00:00
Evan Cheng
e0f2c65756 std::map -> DenseMap for slight compile time benefit.
llvm-svn: 41650
2007-08-31 21:23:06 +00:00
Evan Cheng
a561a94058 Use std::map instead of a (potentially very sparse) array to track val# defined by copy from the other live range. Minor compile time win when number of val# is large.
llvm-svn: 41640
2007-08-31 08:04:17 +00:00
Evan Cheng
5a5046b83f Change LiveRange so it keeps a pointer to the VNInfo rather than an index.
Changes related modules so VNInfo's are not copied. This decrease
copy coalescing time by 45% and overall compilation time by 10% on siod.

llvm-svn: 41579
2007-08-29 20:45:00 +00:00
Evan Cheng
1f3724ee2d Recover most of the compile time regression due to recent live interval changes.
1. Eliminate the costly live interval "swapping".
2. Change ValueNumberInfo container from SmallVector to std::vector. The former
   performs slowly when the vector size is very large.

llvm-svn: 41536
2007-08-28 08:28:51 +00:00
Evan Cheng
ee277f940b Fix some kill info update bugs; add hidden option -disable-rematerialization to turn off remat for debugging.
llvm-svn: 41118
2007-08-16 07:24:22 +00:00
Evan Cheng
f901915207 Fix for PR1596: AdjustCopiesBackFrom() should conservatively check if any of its sub-registers may overlap with the interval of the copy that's being coalesced.
llvm-svn: 41084
2007-08-14 23:19:28 +00:00
Evan Cheng
5b64e19e06 Kill info update bugs.
llvm-svn: 41064
2007-08-14 01:56:58 +00:00
Evan Cheng
215f802b75 Re-implement trivial rematerialization. This allows def MIs whose live intervals that are coalesced to be rematerialized.
llvm-svn: 41060
2007-08-13 23:45:17 +00:00
Evan Cheng
3b211635e8 No need to remove dead range from soon-to-be-dead live interval. Its val# may be out of whack.
llvm-svn: 41024
2007-08-12 01:26:19 +00:00
Evan Cheng
8968affb6d Code to maintain kill information during register coalescing.
llvm-svn: 41016
2007-08-11 00:59:19 +00:00
Chris Lattner
202e7f84e9 unbreak the build
llvm-svn: 40976
2007-08-09 23:55:17 +00:00
Evan Cheng
0293fe7483 Bug fix. ~1U marks the val# dead.
llvm-svn: 40975
2007-08-09 23:14:39 +00:00
Evan Cheng
12d72cc1a0 - Each val# can have multiple kills.
- Fix some minor bugs related to special markers on val# def. ~0U means
  undefined, ~1U means dead val#.

llvm-svn: 40916
2007-08-08 03:00:28 +00:00
Evan Cheng
0182b495fd - LiveInterval value#'s now have 3 components: def instruction #,
kill instruction #, and source register number (iff the value# is defined by a
copy).
- Now def instruction # is set for every value#, not just for copy defined ones.
- Update some outdated code related inactive live ranges.
- Kill info not yet set. That's next patch.

llvm-svn: 40913
2007-08-07 23:49:57 +00:00
Chris Lattner
bc90e7255f shorten this name
llvm-svn: 40843
2007-08-05 18:45:33 +00:00
Evan Cheng
8889a56947 simpleregistercoalescing -> regcoalescing. It's too long for me to handle.
llvm-svn: 40654
2007-07-31 22:37:44 +00:00
Dan Gohman
ac8ccab48f Don't assume that only Uses can be kills. Defs are marked as kills initially
when there are no uses. This fixes a dangling-pointer bug, where pointers to
deleted instructions were not removed from kills lists. More info here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-July/009749.html

llvm-svn: 40131
2007-07-20 23:17:34 +00:00
Evan Cheng
5dd17373c5 Add comment.
llvm-svn: 40022
2007-07-18 23:34:48 +00:00