Commit Graph

72 Commits

Author SHA1 Message Date
Chris Lattner 2979a85984 Add a big assert making sure 2 address instructions are formed right
llvm-svn: 5057
2002-12-15 21:02:20 +00:00
Chris Lattner 02e835bf9a Fix a problem that occurs when PHI nodes have multiple entries for the same predecessor
llvm-svn: 5055
2002-12-15 20:48:03 +00:00
Chris Lattner dfa238f665 Grab bag of minor cleanups. Export some statistics about the number of
spills and reloads emitted

llvm-svn: 5054
2002-12-15 20:36:09 +00:00
Chris Lattner e2533336f5 Simplify interfaces used by regalloc to insert code
llvm-svn: 5052
2002-12-15 20:06:35 +00:00
Chris Lattner c1c7cc290f * Simplify code a bit by breaking the PHI node handling stuff out into a seperate
function from normal regalloc code
* Make the regalloc for a block a function instead of part of runOnMachineBB, which
  makes it easier to see what's going on in runOnMBB.

llvm-svn: 5051
2002-12-15 19:51:14 +00:00
Chris Lattner f2acd842b4 * Remove some unneccesary instance variables
* Make allocateStackSpaceFor only allocate the right amount of space

llvm-svn: 5048
2002-12-15 19:07:34 +00:00
Chris Lattner b772cd05c5 pull inverse reg class mapping into a class that is sharable and out of the
target register description classes.

llvm-svn: 5045
2002-12-15 18:38:59 +00:00
Chris Lattner cf1955cb16 Prune #includes
llvm-svn: 5044
2002-12-15 18:19:24 +00:00
Chris Lattner 1af3af463a Remove extraneous #includes, perform FIXME
llvm-svn: 5043
2002-12-15 18:15:24 +00:00
Chris Lattner 477af9d0fa Fix borkness with not using MachineBasicBlocks in PHI nodes
llvm-svn: 5035
2002-12-15 08:02:51 +00:00
Misha Brukman a1aa29b125 Fixed a bug where moves due to phis were being neglected.
llvm-svn: 5019
2002-12-13 12:33:31 +00:00
Misha Brukman 86ca8840a1 Need to insert all moves due to PHI nodes before *ALL* jumps in a predecessor
basic block, as there could be multiple.

llvm-svn: 5016
2002-12-13 11:55:59 +00:00
Misha Brukman 35a358d981 This should be more correct: invalidates physical registers that are used in
an instruction to avoid using them to allocate to other virtual registers.

llvm-svn: 5013
2002-12-13 11:33:22 +00:00
Misha Brukman 89ff3fbcd6 Fixed bug with running out of registers. Also, reinstated namespace which
disappeared during the last checkin.

llvm-svn: 5007
2002-12-13 10:42:31 +00:00
Misha Brukman a739167305 This should handle register allocating PHI nodes.
llvm-svn: 5002
2002-12-13 09:54:36 +00:00
Misha Brukman 4ef74c8079 Start allocating stack space at [ebp-4] to not overwrite the return address.
Also make all loads & stores 4-byte aligned for performance. ;)

llvm-svn: 4982
2002-12-13 04:34:02 +00:00
Misha Brukman 260dbc79fc Take advantage of our knowledge of 2-address X86 instructions and
register-allocated them appropriately.

llvm-svn: 4976
2002-12-12 23:20:31 +00:00
Misha Brukman 160a3da184 Added code generation for function prologues and epilogues.
llvm-svn: 4930
2002-12-04 23:58:08 +00:00
Misha Brukman dbb7b65bf3 Fun arithmetic with iterators aimed at fixing a bug: inserting instructions
after the *current* instruction while keeping the iterator in the same
'logical' place.

llvm-svn: 4923
2002-12-04 19:24:45 +00:00
Misha Brukman a8ad93221a This should fix the bug seen with some registers not being allocated
correctly: skipping instructions by incorrectly incrementing the pointer.

Also adds support for building a reg-to-regclass map, and splits the function
for saving register to stack into two, one suitable for virtual registers
(which also assigns it a physical register) and one for simply storing back
physical registers.

llvm-svn: 4898
2002-12-03 23:15:19 +00:00
Misha Brukman 2e035d64d1 * Abstracted out stack space allocation into its own function
* Added saving of register values to the stack

llvm-svn: 4858
2002-12-02 21:11:58 +00:00
Misha Brukman 60286d0916 A simple (spilling) register allocator.
llvm-svn: 4828
2002-11-22 22:44:32 +00:00