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
ce23fdeee2
Changes to make new TargetRegisterClass interface.
...
llvm-svn: 5050
2002-12-15 19:29:34 +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
caa325a559
* Simplify TargetRegisterClass implementations
...
* Change regclass iterators to use an extra level of pointers
llvm-svn: 5047
2002-12-15 18:40:36 +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
7a43d882e2
Fix bug: Assembler/2002-12-15-GlobalResolve.ll
...
llvm-svn: 5039
2002-12-15 16:41:52 +00:00
Chris Lattner
05eed92679
planes is not spelled with an O
...
llvm-svn: 5037
2002-12-15 16:20:23 +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
Chris Lattner
50d99540cf
Add support to cast from a bool type
...
Add support for boolean constants
add getClassB method
llvm-svn: 5034
2002-12-15 08:02:15 +00:00
Chris Lattner
534876a78c
Use MachineOperand::isFoo methods instead of our own global functions
...
llvm-svn: 5033
2002-12-15 08:01:39 +00:00
Chris Lattner
61d594690a
Fix a huge performance problem in reassociate by introducing a
...
rank map cache for instruction ranks
llvm-svn: 5030
2002-12-15 03:56:00 +00:00
Chris Lattner
18fe81719d
Minor changes:
...
* Reword comment to make more clear
* Don't print out BB's after modification made
* Don't delete and new an instruction when we need to move something, just move it.
llvm-svn: 5029
2002-12-15 03:49:50 +00:00
Chris Lattner
bd4d66147f
Implement indirect function calls
...
llvm-svn: 5024
2002-12-13 14:13:27 +00:00
Misha Brukman
3587ffc7b1
Make function code generation printing debug-only.
...
llvm-svn: 5023
2002-12-13 13:16:14 +00:00
Chris Lattner
c7db3e855f
Fix bork in doMultiply
...
llvm-svn: 5021
2002-12-13 13:07:42 +00:00
Chris Lattner
7d5d4f7ab4
Add sanity checks
...
llvm-svn: 5020
2002-12-13 13:04:04 +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
2f2cf00a9f
Cleaned up the code: factored out switch/case into a separate function, put
...
constants in an array for quick lookup. Stole the idea from elsewhere in
Jello.
llvm-svn: 5017
2002-12-13 12:00:06 +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
Chris Lattner
de2f97c5e6
Insert phi code at top of block
...
llvm-svn: 5015
2002-12-13 11:52:34 +00:00
Brian Gaeke
460fe53768
lib/Target/X86/InstSelectSimple.cpp:
...
The MachineBasicBlock variable name patrol hereby fines Chris Lattner
one bag of nachos, for shadowing global names while his license to do so
was under suspension.
llvm-svn: 5014
2002-12-13 11:39:18 +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
Chris Lattner
2c2a5f128e
Implement cast bool to X
...
llvm-svn: 5012
2002-12-13 11:31:59 +00:00
Brian Gaeke
b101130d19
Rename all BMI MachineBasicBlock operands to MBB.
...
Try to mess around with emitGEPOperation's elementSizeReg to make it work,
again.
llvm-svn: 5011
2002-12-13 11:22:48 +00:00
Chris Lattner
cad7e99ea1
Finish up iterator stuph
...
llvm-svn: 5009
2002-12-13 10:50:40 +00:00
Misha Brukman
b6fb990276
Treat longs as ints => pretend they're all 32-bit values and squeeze them into
...
32-bit registers.
llvm-svn: 5008
2002-12-13 10:43:09 +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
Chris Lattner
416a9ca8f1
Code gen phi's correctly
...
llvm-svn: 5004
2002-12-13 10:09:43 +00:00
Chris Lattner
505ace489e
Print X86 PHI nodes in a sane manner
...
llvm-svn: 5003
2002-12-13 09:59:26 +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
fb02408496
Added moveReg2Reg() and moveImm2Reg() to accomodate moving data around due to
...
PHI nodes.
llvm-svn: 5001
2002-12-13 09:54:12 +00:00
Brian Gaeke
34ad176df5
lib/Target/X86/InstSelectSimple.cpp: Start counting arguments with 2,
...
because arguments start two stack slots off of EBP. Break out of the
for loop once the argument is found. Increment the counter at the end
of the loop instead of the beginning. Use addRegOffset and compute
the scale * index part at compile time instead of using the fancy
load instruction. Just because an instruction set has wacky addressing
modes doesn't mean we ought to use them (at least, if you believe Dave
Patterson).
lib/Target/X86/X86InstrBuilder.h: Add some comments.
test/Regression/Jello/test-loadstore.ll: Let main return int 0.
llvm-svn: 4999
2002-12-13 09:28:50 +00:00
Brian Gaeke
5da234a1d7
InstSelectSimple.cpp: Give promote32 a comment. Add initial
...
implementation of getReg() for arguments.
MachineCodeEmitter.cpp: Fix using EBP with index, scale and no
displacement (whew!) due to Chris.
Printer.cpp: Fix printing out index and scale in memory references.
llvm-svn: 4998
2002-12-13 07:56:18 +00:00
Chris Lattner
9e7b73b55f
Implement getelementptr constant exprs
...
Implement ConstantPointerRefs
Treat long/ulongs as if they were integers. A hack, but an effective one
llvm-svn: 4995
2002-12-13 06:56:29 +00:00
Brian Gaeke
641c6fa60a
brg
...
InstSelectSimple.cpp: Add stub implementation of visitFreeInst.
Add comments that mention how we are failing to implement malloc/free.
Add initial implementation of visitAllocaInst.
X86TargetMachine.cpp: Include llvm/Transforms/Scalar.h.
Add LowerAllocations pass before instruction selection.
jello/Makefile: Add scalaropts.a.
llvm-svn: 4994
2002-12-13 06:46:31 +00:00
Chris Lattner
62454d83f0
Emit the right form of mod/rm mod field
...
llvm-svn: 4986
2002-12-13 05:05:05 +00:00
Chris Lattner
7ec625a157
Nicify a bit
...
llvm-svn: 4985
2002-12-13 05:04:37 +00:00
Chris Lattner
4cc9894c71
Fix encoding of CBW instruction
...
llvm-svn: 4983
2002-12-13 04:41:31 +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
20c9c61c6d
Moves now select correct opcode based on the data size.
...
llvm-svn: 4981
2002-12-13 04:24:53 +00:00
Chris Lattner
10f305cec7
Remove extranous #include
...
llvm-svn: 4980
2002-12-13 04:12:24 +00:00
Chris Lattner
723ca2522d
Rename MemArg* to Arg*
...
llvm-svn: 4979
2002-12-13 03:51:55 +00:00