1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

526 Commits

Author SHA1 Message Date
Chris Lattner
c10678de64 * Convert to be a MachineFunctionPass instance
* Use new FunctionFrameInfo object to manage stack slots instead of doing
  it directly
* Adjust to new MRegisterInfo API
* Don't take a TM as a ctor argument
* Don't keep track of which callee saved registers are modified
* Don't emit prolog/epilog code or spill/restore code for callee saved regs
* Use new allocation_order_begin/end iterators to simplify dramatically the
  logic for picking registers to allocate
* Machine PHI nodes can no longer contain constant arguments

* Use a bitvector to keep track of registers used instead of a set
* Fix problem where explicitly referenced registers would be added to
  regsused set and never removed

llvm-svn: 5196
2002-12-28 20:42:14 +00:00
Chris Lattner
239563061c * Convert to be a MachineFunctionPass instance
* Use new FunctionFrameInfo object to manage stack slots instead of doing
  it directly
* Adjust to new MRegisterInfo API
* Don't take a TM as a ctor argument
* Don't keep track of which callee saved registers are modified
* Don't emit prolog/epilog code or spill/restore code for callee saved regs
* Use new allocation_order_begin/end iterators to simplify dramatically the
  logic for picking registers to allocate
* Machine PHI nodes can no longer contain constant arguments

llvm-svn: 5195
2002-12-28 20:40:43 +00:00
Chris Lattner
831939c09a * Add printing support for FrameIndex operands
llvm-svn: 5194
2002-12-28 20:37:37 +00:00
Chris Lattner
64b1ad63c1 * A bunch of functionality and data was removed from MachineFunction and put
into a new MachineFunctionInfo class
* Implement new FunctionFrameInfo class

llvm-svn: 5193
2002-12-28 20:37:16 +00:00
Chris Lattner
6ce5c54520 Frame info moved out of MachineFunction into a seperate object
llvm-svn: 5192
2002-12-28 20:35:34 +00:00
Chris Lattner
3a506e6f14 Adjust to simpler spill interface
Only spill and reload caller saved registers that are actually modified.

llvm-svn: 5145
2002-12-25 05:05:46 +00:00
Chris Lattner
1f19acbda7 Adjustments to work with the simpler spill interface
llvm-svn: 5144
2002-12-25 05:04:20 +00:00
Chris Lattner
10edd6367e Remove dependency on SSARegMap.h by MachineFunction.h
llvm-svn: 5143
2002-12-25 05:03:22 +00:00
Chris Lattner
7888f74224 Substantial fixes to live range handling, fixing several problems, getting
strtol to not miscompile, and fixing bug: 2002-12-23-LocalRAProblem.llx

llvm-svn: 5132
2002-12-24 00:04:55 +00:00
Chris Lattner
7abe5199b3 Fix compilation on GCC 2.96
llvm-svn: 5113
2002-12-23 23:44:04 +00:00
Chris Lattner
5ddc4b5f94 * Fix several register aliasing bugs
* Add a new option to eliminate spilling of registers that are only used
  within a basic block.

llvm-svn: 5106
2002-12-18 08:14:26 +00:00
Chris Lattner
bb2e7ec2b1 Implicit defs/uses list may be empty.
llvm-svn: 5103
2002-12-18 01:11:14 +00:00
Chris Lattner
c6ac5c70c6 Use new reginfo interface
llvm-svn: 5099
2002-12-17 04:19:40 +00:00
Chris Lattner
e66a7e80c3 Add prolog/epilog spills/reloads to counters
Move X86 specific alignment gunk to X86 files

llvm-svn: 5096
2002-12-17 03:16:10 +00:00
Chris Lattner
8dd15fd26c Fix many bugs, regallocator now saves callee-save registers instead of target
llvm-svn: 5093
2002-12-17 02:50:10 +00:00
Chris Lattner
cdcde16ad0 * Fix a gross X86 hack that was intended to avoid allocating SP and BP
* Implement register alias set support

llvm-svn: 5082
2002-12-16 17:44:42 +00:00
Chris Lattner
0ede83ee56 Keep the stack frame aligned.
llvm-svn: 5081
2002-12-16 17:42:40 +00:00
Chris Lattner
d44868a709 Initial checkin of "local" register allocator. Bugs are still present.
llvm-svn: 5078
2002-12-16 16:15:28 +00:00
Chris Lattner
064dd4ef95 Rename createSimpleX86RegisterAllocator to createSimpleRegisterAllocator.
Remvoe some dead code

llvm-svn: 5070
2002-12-16 14:37:00 +00:00
Chris Lattner
93b0272717 Some simpliciations to the spill/reload interface
llvm-svn: 5067
2002-12-15 23:01:26 +00:00
Chris Lattner
6a2d7bef14 Simplify PHI node elimination significantly by doing it as a prepass to
register allocation

llvm-svn: 5066
2002-12-15 22:39:53 +00:00
Chris Lattner
ebb82f7f96 Variety of small or trivial simplifications to the code, completely eliminated
the dependence on PhysRegClassMap

llvm-svn: 5064
2002-12-15 22:19:19 +00:00
Chris Lattner
370918a2db Remove unused savePhysRegToStack method
llvm-svn: 5061
2002-12-15 21:33:51 +00:00
Chris Lattner
35ceaa7322 Localize a map, remove another
llvm-svn: 5060
2002-12-15 21:24:30 +00:00
Chris Lattner
f499e065be Give simple reg allocator a nice Pass Name
llvm-svn: 5058
2002-12-15 21:13:12 +00:00
Chris Lattner
da3e75b117 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
e8acf72d80 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
234abaea18 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
dd307412c4 Implement printing of MBB arguments
llvm-svn: 5053
2002-12-15 20:35:25 +00:00
Chris Lattner
4214ac384a Simplify interfaces used by regalloc to insert code
llvm-svn: 5052
2002-12-15 20:06:35 +00:00
Chris Lattner
351dc9af16 * 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
6c5c2a58ee * 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
c43cb38245 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
2c20e950be Prune #includes
llvm-svn: 5044
2002-12-15 18:19:24 +00:00
Chris Lattner
aab9196e79 Remove extraneous #includes, perform FIXME
llvm-svn: 5043
2002-12-15 18:15:24 +00:00
Chris Lattner
41ad5c9aff Fix borkness with not using MachineBasicBlocks in PHI nodes
llvm-svn: 5035
2002-12-15 08:02:51 +00:00
Misha Brukman
de680081ab Fixed a bug where moves due to phis were being neglected.
llvm-svn: 5019
2002-12-13 12:33:31 +00:00
Misha Brukman
1f57df5fad 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
0bfbbc73f2 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
e694e406a4 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
af40b6adcd This should handle register allocating PHI nodes.
llvm-svn: 5002
2002-12-13 09:54:36 +00:00
Misha Brukman
e5a8dcc695 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
12bec4ecef 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
8f56246d62 Added code generation for function prologues and epilogues.
llvm-svn: 4930
2002-12-04 23:58:08 +00:00
Misha Brukman
566bac5ec1 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
Chris Lattner
994984de43 Print out direct global references
llvm-svn: 4906
2002-12-04 06:44:41 +00:00
Misha Brukman
f13126a427 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
Chris Lattner
47478b4dce Checkin debug implementation of MCE
llvm-svn: 4893
2002-12-03 20:56:42 +00:00
Misha Brukman
f776547336 * 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
021bf57248 A simple (spilling) register allocator.
llvm-svn: 4828
2002-11-22 22:44:32 +00:00