Chris Lattner
25dd6b0a24
That funny 2-address lowering pass can also cause multiple definitions,
...
fortunately, they are easy to handle if we know about them. This patch fixes
some serious pessimization of code produced by the linscan register allocator.
llvm-svn: 15092
2004-07-22 00:04:14 +00:00
Chris Lattner
eb21652fba
Minor cleanups
...
llvm-svn: 15091
2004-07-21 23:17:57 +00:00
Brian Gaeke
f18cdca667
These files don't need to include <iostream> since they include "Support/Debug.h".
...
llvm-svn: 15089
2004-07-21 20:50:33 +00:00
Alkis Evlogimenos
40d8d044fe
Fix analysis name.
...
llvm-svn: 15078
2004-07-21 17:23:44 +00:00
Alkis Evlogimenos
183f8af791
Clear spilled list at once. Remove unused vector.
...
llvm-svn: 15073
2004-07-21 12:00:10 +00:00
Alkis Evlogimenos
c767432a26
Change std::list into a std::vector for IntervalSets. This reduces
...
compile time for 176.gcc from 5.6 secs to 4.7 secs.
llvm-svn: 15072
2004-07-21 09:46:55 +00:00
Alkis Evlogimenos
8a162136e1
Improve file comment.
...
llvm-svn: 15069
2004-07-21 08:28:39 +00:00
Alkis Evlogimenos
b5f60641f4
Add Iterative scan register allocator.
...
llvm-svn: 15068
2004-07-21 08:24:35 +00:00
Alkis Evlogimenos
75dbcf6d06
Linearscan is no longer experimental.
...
llvm-svn: 15067
2004-07-21 08:18:50 +00:00
Alkis Evlogimenos
cb3b2fc439
Add function to clear all virtual->physical mappings but not assigned
...
stack slots. This is in preparation for the iterative linear scan.
llvm-svn: 15032
2004-07-20 13:28:17 +00:00
Alkis Evlogimenos
89ae43ca19
Remove unneeded functor. LiveInterval has a < operator.
...
llvm-svn: 15031
2004-07-20 10:20:03 +00:00
Alkis Evlogimenos
25fb592aa6
Remove dead code.
...
llvm-svn: 15011
2004-07-19 23:35:55 +00:00
Chris Lattner
c07b7fff45
Fix a bug that occurs when the last instruction in a range is dead
...
llvm-svn: 15005
2004-07-19 15:16:53 +00:00
Chris Lattner
bc53c119ac
When joining intervals, join intervals in deeply nested loops first. This
...
is a simple change, but seems to improve code a little. For example, on
256.bzip2, we went from 75.0s -> 73.33s (2% speedup).
llvm-svn: 15004
2004-07-19 14:40:29 +00:00
Chris Lattner
997f36e53f
Split joinIntervals into two methods
...
llvm-svn: 15003
2004-07-19 14:08:10 +00:00
Chris Lattner
22728e2f27
There is no need to store the MBB along with the MI any more, we can now
...
ask instructions for their parent.
llvm-svn: 14998
2004-07-19 07:04:55 +00:00
Chris Lattner
6c34920110
Simplify the interface to LiveVariables::addVirtualRegister(Killed|Dead)
...
llvm-svn: 14997
2004-07-19 06:55:21 +00:00
Chris Lattner
53fa752649
Remove the DefBlock element of VarInfo. DefBlock is always DefInst->getParent()
...
llvm-svn: 14996
2004-07-19 06:26:50 +00:00
Chris Lattner
e7104f6f7b
Two changes, both very significant:
...
* vreg <-> vreg joining now works, enable it unconditionally when joining
is enabled (which is the default).
* Fix a serious pessimization of spill code where we were saying that a
spilled DEF operand was live into the subsequent instruction. This allows
for substantially better code when spilling starts to happen.
llvm-svn: 14993
2004-07-19 05:55:50 +00:00
Chris Lattner
70d06b5c25
See comments. The live intervals were not coming out of the spiller in sorted
...
order, causing the inactive list in the linearscan list to get unsorted, which
basically fuxored everything up severely.
These seems to fix the joiner, so with more testing I will enable it by default.
llvm-svn: 14992
2004-07-19 05:15:10 +00:00
Chris Lattner
f5bdaf62f8
Fix assertion to not dereference end!
...
llvm-svn: 14991
2004-07-19 05:02:09 +00:00
Chris Lattner
42b44d3d1c
Add some asserts that the list of intervals returned by addIntervalsForSpills
...
is sorted. This is not the case currently, which is causing no end of
problems.
llvm-svn: 14990
2004-07-19 04:47:36 +00:00
Chris Lattner
10caeead75
remove the mbbi2mbbMap_, which was just keeping track of mbb order anyway.
...
Heavily refactor handleVirtualRegisterDef, adding comments and making it more
efficient. It is also much easier to follow and convince ones self that it is
correct :)
Add -debug output to the joine, showing the result of joining the intervals.
llvm-svn: 14989
2004-07-19 02:15:56 +00:00
Chris Lattner
caba8651cd
fill comment to 80 cols
...
remove map that is not needed
llvm-svn: 14988
2004-07-19 02:13:59 +00:00
Chris Lattner
a2b1dbead8
It looks like physref->virtreg joining is working fine. Enable it by default
...
but make virtreg->virtreg joining stay off by default
llvm-svn: 14916
2004-07-17 21:51:25 +00:00
Chris Lattner
c014005d53
Fix IA64 compatibility
...
llvm-svn: 14866
2004-07-16 00:06:01 +00:00
Chris Lattner
53c9460cde
Use new macro
...
llvm-svn: 14865
2004-07-16 00:04:54 +00:00
Chris Lattner
47c6a06211
Fix for PR341
...
llvm-svn: 14845
2004-07-15 02:40:04 +00:00
Chris Lattner
456583c52c
Add checks to ensure that there are no unreachable blocks in the function
...
llvm-svn: 14725
2004-07-09 16:44:37 +00:00
Misha Brukman
abbe59490b
* Doxygenify comments
...
* Fix spacing, grammar in comment
* Make code layout consistent
* Wrap code at 80 cols
* Delete spurious blank lines
No functional changes.
llvm-svn: 14721
2004-07-09 14:45:17 +00:00
Alkis Evlogimenos
d8e8396e33
Fix typo.
...
llvm-svn: 14720
2004-07-09 11:25:27 +00:00
Alkis Evlogimenos
57839c592a
Improve code comments.
...
llvm-svn: 14719
2004-07-09 11:10:00 +00:00
Alkis Evlogimenos
e7e19f771f
Add viewCFG() and viewCFGOnly() APIs.
...
llvm-svn: 14679
2004-07-08 00:47:58 +00:00
Alkis Evlogimenos
51dda289a7
Disable coalescing.
...
llvm-svn: 14655
2004-07-07 02:03:12 +00:00
Alkis Evlogimenos
e0c8d140a9
Do not crash when joining two intervals of registers of different
...
classes: just ignore that move. Thanks to Vladimir Prus who found the
bug!
llvm-svn: 14644
2004-07-06 16:03:21 +00:00
Chris Lattner
d450ccbc91
Fix a bug in the unreachable block elim pass. Dropping all references on a
...
basic block clear()'s all of the operands lists, including phis. This
caused removePredecessor to get confused later. Because of this, we just
nuke (without prejudice) PHI nodes in unreachable blocks.
llvm-svn: 14635
2004-07-06 06:36:11 +00:00
Alkis Evlogimenos
69ea68d4b6
Correctly compute the ration of iterations/#intervals.
...
llvm-svn: 14626
2004-07-04 17:23:35 +00:00
Reid Spencer
50ec3f9325
Add #include <iostream> since Value.h does not #include it any more.
...
llvm-svn: 14622
2004-07-04 12:19:56 +00:00
Alkis Evlogimenos
8ff35c1ce8
Add efficiency statistic.
...
llvm-svn: 14590
2004-07-04 07:59:06 +00:00
Chris Lattner
5b96ed7d1b
Revert patches 1.79 and 1.80 which had to do with dead MBB's. Now that they
...
don't exist, we don't have to pretend to handle them.
llvm-svn: 14567
2004-07-02 05:52:23 +00:00
Chris Lattner
1e20aefbcb
Add a trivially simple pass to delete unreachable blocks from the CFG. This
...
pass is required to paper over problems in the code generator (primarily
live variables and its clients) which doesn't really have any well defined
semantics for unreachable code.
The proper solution to this problem is to have instruction selectors not
select blocks that are unreachable. Until we have a instruction selection
framework available for use, however, we can't expect all instruction
selector writers to do this. Until then, this pass should be used.
llvm-svn: 14563
2004-07-02 05:46:10 +00:00
Chris Lattner
91662f48b8
Make sure that we destroy the MBB's, with all of their instructions, before
...
any other data structures
llvm-svn: 14524
2004-07-01 06:29:07 +00:00
Chris Lattner
93bf3a5985
Now that MachineFunction/MachineBasicBlock keep a mapping of blocks to ID #'s
...
use them instead of a local LiveVariables numbering
llvm-svn: 14523
2004-07-01 06:15:32 +00:00
Chris Lattner
43e765d61c
Change MBB autonumber a bit to get the reverse mapping as well as a forward
...
mapping
llvm-svn: 14521
2004-07-01 06:02:27 +00:00
Chris Lattner
a2481b7e82
Instance var no longer exists
...
llvm-svn: 14520
2004-07-01 06:02:07 +00:00
Chris Lattner
ae4f21e30a
Start using MBB numbers directly instead of going through the live variables
...
map.
llvm-svn: 14518
2004-07-01 04:29:47 +00:00
Chris Lattner
0bb956cda7
Instead of building a private numbering of MBB's use brg's nifty auto-numbering.
...
Also convert df_iterator -> df_ext_iterator for subsequent stuff I'm doing.
llvm-svn: 14517
2004-07-01 04:24:29 +00:00
Chris Lattner
41c3157c70
In line with the previous patch, do not assert out if analyzing a dead basic block.
...
llvm-svn: 14475
2004-06-29 07:16:23 +00:00
Chris Lattner
27c176234c
Do not dereference end iterators. It hurts when you do that.
...
llvm-svn: 14474
2004-06-29 06:56:51 +00:00
Chris Lattner
fd25f66f50
Do not find these ugly sparc-specific objects by using the annotation API on
...
instructions. Instead, keep a map of instructions -> MCFI objects in the
already sparc-specific class MachineFunctionInfo. This will slow down the
sparc backend a bit, but it does not penalize the rest of LLVM!
llvm-svn: 14438
2004-06-27 18:52:17 +00:00