Commit Graph

512 Commits

Author SHA1 Message Date
Chris Lattner
ae64043737 Fix many bugs, regallocator now saves callee-save registers instead of target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5093 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-17 02:50:10 +00:00
Chris Lattner
c21be922bf * Fix a gross X86 hack that was intended to avoid allocating SP and BP
* Implement register alias set support


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5082 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 17:44:42 +00:00
Chris Lattner
69c198863d Keep the stack frame aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5081 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 17:42:40 +00:00
Chris Lattner
b74e83c898 Initial checkin of "local" register allocator. Bugs are still present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5078 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 16:15:28 +00:00
Chris Lattner
1d62cea90b Rename createSimpleX86RegisterAllocator to createSimpleRegisterAllocator.
Remvoe some dead code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5070 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 14:37:00 +00:00
Chris Lattner
b167c04e62 Some simpliciations to the spill/reload interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5067 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 23:01:26 +00:00
Chris Lattner
8ed9eb5ca3 Simplify PHI node elimination significantly by doing it as a prepass to
register allocation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5066 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 22:39:53 +00:00
Chris Lattner
9f366d7ab6 Variety of small or trivial simplifications to the code, completely eliminated
the dependence on PhysRegClassMap


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5064 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 22:19:19 +00:00
Chris Lattner
f605055994 Remove unused savePhysRegToStack method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5061 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 21:33:51 +00:00
Chris Lattner
01b08c59b4 Localize a map, remove another
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5060 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 21:24:30 +00:00
Chris Lattner
8233e2fe01 Give simple reg allocator a nice Pass Name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5058 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 21:13:12 +00:00
Chris Lattner
15f96db4d9 Add a big assert making sure 2 address instructions are formed right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5057 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 21:02:20 +00:00
Chris Lattner
3f91ad7ba7 Fix a problem that occurs when PHI nodes have multiple entries for the same predecessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5055 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 20:48:03 +00:00
Chris Lattner
da7e453aac Grab bag of minor cleanups. Export some statistics about the number of
spills and reloads emitted


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5054 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 20:36:09 +00:00
Chris Lattner
2109f502d6 Implement printing of MBB arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5053 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 20:35:25 +00:00
Chris Lattner
198ab640bb Simplify interfaces used by regalloc to insert code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5052 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 20:06:35 +00:00
Chris Lattner
c2db1a95df * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5051 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 19:51:14 +00:00
Chris Lattner
9593fb1503 * Remove some unneccesary instance variables
* Make allocateStackSpaceFor only allocate the right amount of space


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5048 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 19:07:34 +00:00
Chris Lattner
dd444f9242 pull inverse reg class mapping into a class that is sharable and out of the
target register description classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5045 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 18:38:59 +00:00
Chris Lattner
abe8dd592d Prune #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5044 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 18:19:24 +00:00
Chris Lattner
ad44bd99ff Remove extraneous #includes, perform FIXME
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5043 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 18:15:24 +00:00
Chris Lattner
71c83728b4 Fix borkness with not using MachineBasicBlocks in PHI nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5035 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 08:02:51 +00:00
Misha Brukman
0868667f78 Fixed a bug where moves due to phis were being neglected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5019 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 12:33:31 +00:00
Misha Brukman
74676da6f1 Need to insert all moves due to PHI nodes before *ALL* jumps in a predecessor
basic block, as there could be multiple.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5016 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 11:55:59 +00:00
Misha Brukman
972b03fa53 This should be more correct: invalidates physical registers that are used in
an instruction to avoid using them to allocate to other virtual registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5013 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 11:33:22 +00:00
Misha Brukman
59b3eedf31 Fixed bug with running out of registers. Also, reinstated namespace which
disappeared during the last checkin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5007 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 10:42:31 +00:00
Misha Brukman
203b769b20 This should handle register allocating PHI nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 09:54:36 +00:00
Misha Brukman
cea2245f04 Start allocating stack space at [ebp-4] to not overwrite the return address.
Also make all loads & stores 4-byte aligned for performance. ;)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4982 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 04:34:02 +00:00
Misha Brukman
d1bedcced2 Take advantage of our knowledge of 2-address X86 instructions and
register-allocated them appropriately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4976 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-12 23:20:31 +00:00
Misha Brukman
dd46e2a81d Added code generation for function prologues and epilogues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4930 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 23:58:08 +00:00
Misha Brukman
06f8aecc88 Fun arithmetic with iterators aimed at fixing a bug: inserting instructions
after the *current* instruction while keeping the iterator in the same
'logical' place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4923 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 19:24:45 +00:00
Chris Lattner
b72d221d61 Print out direct global references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4906 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 06:44:41 +00:00
Misha Brukman
dc2ec004f1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4898 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 23:15:19 +00:00
Chris Lattner
f815aebd20 Checkin debug implementation of MCE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4893 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 20:56:42 +00:00
Misha Brukman
f514d51b20 * Abstracted out stack space allocation into its own function
* Added saving of register values to the stack


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4858 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:11:58 +00:00
Misha Brukman
0721867c8d A simple (spilling) register allocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4828 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-22 22:44:32 +00:00
Misha Brukman
b7825bc725 Initialize the SSARegMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4782 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 18:55:27 +00:00
Chris Lattner
af55be15df Print is const!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4737 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 23:22:13 +00:00
Chris Lattner
570f55de8d Remove only uses of markDef/markDefAndUse methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4719 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:14:08 +00:00
Chris Lattner
0006bd7520 Fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4649 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 00:49:43 +00:00
Chris Lattner
5da2e6ac70 Move function to cpp file from header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4510 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 22:07:51 +00:00
Chris Lattner
ec3e2f41cd New iostream definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4482 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-01 16:46:05 +00:00
Vikram S. Adve
26fbcec43b Restore support for indirect function calls (which briefly wasn't working
after I removed annotations on MachineInstr for the CallDescriptor).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4469 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 15:34:48 +00:00
Chris Lattner
188732c971 Remove fixme
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4447 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 02:02:37 +00:00
Chris Lattner
6a592271fb Add special code to make printing SSA form machine instructions nicer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4446 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 01:55:38 +00:00
Chris Lattner
2a79a0927c Use MRegisterInfo, if available, to print symbolic register names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4438 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 00:58:19 +00:00
Chris Lattner
1049164aa6 Implement structured machine code printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4435 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 00:48:05 +00:00
Chris Lattner
88726188fe Make argsize calculation stuff optional, so that Targets without FrameInfo
objects yet don't die


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4427 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:40:03 +00:00
Chris Lattner
ddd7fcb887 Implement autoinserting ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4426 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:19:00 +00:00
Chris Lattner
e316efc0e7 Rename annotation id
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4425 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:18:43 +00:00