Commit Graph

385 Commits

Author SHA1 Message Date
Chris Lattner
a8cb100706 Add IMULr16 & IMULr32 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6829 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 17:13:35 +00:00
Chris Lattner
f58544712b Generate code for LONG indexes to getelementptr instructions more efficiently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6828 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 16:01:24 +00:00
Brian Gaeke
3387e7f7a2 Fix output bug: Intel asm comment character is #, not ;.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6792 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:58:32 +00:00
Brian Gaeke
088fa1162d RECAPITALIZE all the names of pseudo-instructions, and add a comment explaining
the convention.

:-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6791 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:41:13 +00:00
Brian Gaeke
96b07e54dd Rename many instructions to their Intel asm-compatible names. This
involves removing the [bwl] suffixes from instruction names, as well
as some other distinguishing marks (32/64/80 on fp insns, _i suffixes, etc.)

Lowercase all instr. names as well for consistency's sake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6790 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:34:44 +00:00
Brian Gaeke
9e474c4ec8 Add Initialization and Finalization methods for the Printer pass,
to print various things on a module-by-module basis (currently, only the
former is used).

Don't print < > around names. The assembler can't take it.

Print pseudoinstructions only as comments. The poor little assembler can't
take that, either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6789 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:32:32 +00:00
Brian Gaeke
de3aa4f77f lib/Target/X86/X86TargetMachine.{cpp,h}: Add initial version
(non-working) of llc guts for X86, and add a prototype for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6779 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 21:43:21 +00:00
Brian Gaeke
ad95d9ef50 Isolate machine-dependent use of <alloca.h> in "Support/Alloca.h",
so that we can easily change its use to be conditional on the result of
an autoconf test later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6723 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 21:54:01 +00:00
Chris Lattner
30d002bd66 Fix warnings on Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6658 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 18:25:33 +00:00
Chris Lattner
302de59001 Add statistic for # machine instrs emitted
Add GROSS HACK to get CompilationCallback to work when compiled in release mode


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6646 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 04:00:05 +00:00
Chris Lattner
333864d81b Implement generation of cmp R, C to not use an extra register
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6627 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 19:30:30 +00:00
Chris Lattner
35333e16ee Special case simple binary operator X op C
This avoid generating a register to hold C, which in turn speeds up the
  register allocator by a lot: ~9% on 164.gzip and ~17% on 256.bzip2.  This
  also speeds up other passes.  This also speeds up execution of the program
  marginally, and makes the asm much easier to read. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6626 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 18:28:55 +00:00
Chris Lattner
76594014f2 Add instructions for (add|sub|and|or|xor)ri(8|16|32)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6625 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 18:25:08 +00:00
Chris Lattner
8cc72d2968 Remove usage of typedef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6583 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 15:41:58 +00:00
Chris Lattner
ff3261ae86 Add namespace comments for doxygen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6581 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 15:31:23 +00:00
Misha Brukman
bc80b2249a Eliminated a compiler warning due to casting to a different-sized datatype.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6531 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 04:13:58 +00:00
Misha Brukman
cd60313915 Renamed MachineCodeEmitter.cpp -> X86CodeEmitter.cpp as it conflicts with the
target-independent lib/CodeGen/MachineCodeEmitter.cpp; preserved CVS history.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6528 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 03:28:00 +00:00
Chris Lattner
04b0b309c4 Move X86 specific code out of the JIT into the X86 backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6516 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 23:23:50 +00:00
Chris Lattner
20772547c5 * Implement cast (long|ulong) to bool
* Fix cast of (short|ushort|int|uint) to bool to work right


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6510 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 03:38:24 +00:00
Chris Lattner
6c8125fa56 Add RR forms of test instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6509 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 03:37:46 +00:00
Chris Lattner
9171ef5e8d Add support for shl and shr for 64 bit integer types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6499 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 01:56:54 +00:00
Chris Lattner
3f7905bdec Add definitions for TEST instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6498 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 01:56:39 +00:00
Chris Lattner
8d8e0c6e83 Add new cmovne32 instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6496 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 00:05:15 +00:00
Vikram S. Adve
49cab03c81 Renamed opIsDef to opIsDefOnly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6340 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 00:03:17 +00:00
Misha Brukman
12745c55e1 Reword to remove reference to how things worked in the past.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6323 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-24 01:08:43 +00:00
Misha Brukman
e9d883828a Implement the TargetInstrInfo's createNOPinstr() and isNOPinstr() interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6320 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-24 00:09:50 +00:00
Chris Lattner
67580ed715 Clean up #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6173 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-13 20:21:19 +00:00
Chris Lattner
9d6d118837 Make abort more explicit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6151 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 21:16:26 +00:00
Chris Lattner
b70c1381b4 Remove the assertion failure of course... doh
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6150 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 20:39:39 +00:00
Chris Lattner
4d5a50a7a6 Implement casts from unsigned integers to floating point
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6148 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 20:36:13 +00:00
Chris Lattner
c53544af06 Make error messages more useful than jsut an abort
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6146 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 20:16:58 +00:00
Chris Lattner
a6e73f1956 Do not insert multiple initializations for the same value in a PHI node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6113 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 14:22:21 +00:00
Chris Lattner
992ab561f0 This blank line has GOT to go.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6057 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-09 03:28:13 +00:00
Chris Lattner
b515f6d2c8 Add support for Add, Sub, And, Or, & Xor constant exprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6049 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 20:49:25 +00:00
Chris Lattner
eca195e7b4 Add support for variable argument functions!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6046 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 19:44:13 +00:00
Chris Lattner
c248903b2a IMPLICIT_DEF was not the beautiful elegant solution I thought it was going
to be.  In fact, it made stuff worse.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6013 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-07 19:21:28 +00:00
Chris Lattner
dbd7372665 Emit pseudo instructions to indicate that some registers are live on entrance
and exit of the function.  This fixes bug: Jello/2003-05-06-LivenessClobber.llx
and the Fhourstones benchmark


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6010 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-06 21:32:22 +00:00
Chris Lattner
9dedbcc3d5 Don't have a cow with new pseudo instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6009 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-06 21:31:47 +00:00
Chris Lattner
eab49345cb Add two new pseudo instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6008 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-06 21:31:31 +00:00
Misha Brukman
48196b3813 The Hyphenation-Adding Committee is now in session.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5986 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-03 02:18:17 +00:00
Chris Lattner
10daaa1416 Remove two fields from TargetData which are target specific.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5963 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-26 20:11:09 +00:00
Chris Lattner
8bdd129c8a Fix bogus assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5949 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-25 21:58:54 +00:00
Chris Lattner
98938f83d5 Fix compatibility bug: X86 aligns doubles to 4 bytes, not 8!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5935 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-25 06:05:57 +00:00
Chris Lattner
3907d11200 Fix iterator invalidation problem with cast instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5876 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 17:57:48 +00:00
Chris Lattner
548f61d66a Implement the constantexpr CAST instruction correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5875 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 17:22:12 +00:00
Chris Lattner
155e68feea Add support for the Switch instruction by running the lowerSwitch pass first
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5867 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 16:24:55 +00:00
Misha Brukman
8829dcd15b It's "necessary"...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5848 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 20:20:11 +00:00
Misha Brukman
baf0607cbc It's "necessary" to spell "necessarily" correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5833 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 17:54:23 +00:00
Chris Lattner
4b12cdec01 Add support for a simple constantexpr: cast of one ptr type to another
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5829 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-21 21:33:44 +00:00
Chris Lattner
ddd5b417c6 Rename -no-* to -disable-*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5642 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-26 20:00:41 +00:00
Chris Lattner
55f6fab9f1 Don't emit unneccesary branch instructions!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5328 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-16 18:07:23 +00:00
Chris Lattner
ee3e4356fc Fix problem with invalidated iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5327 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-16 18:07:13 +00:00
Chris Lattner
6d40c191ee Implement optimization folding setcc into branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5324 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-16 16:43:00 +00:00
Chris Lattner
b037ee822c Add more flavors of branch instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5323 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-16 16:42:45 +00:00
Chris Lattner
f158da2f78 Implement code to keep the stack pointer aligned to an 8 byte boundary.
This improves the performance of the power benchmark by a few percent.
This will be neccesary for SSE code, which requires 16 byte alignment of
the stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5320 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-16 02:20:12 +00:00
Chris Lattner
eafa423881 Handle frame offset due to return address pushed on the stack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5319 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-15 22:57:35 +00:00
Chris Lattner
1a57ccdfbf X86 backend should never use addMReg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-15 00:04:14 +00:00
Chris Lattner
3501feab81 Rename MachineInstrInfo -> TargetInstrInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5272 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-14 22:00:31 +00:00
Chris Lattner
a960d95253 New files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5260 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 01:01:59 +00:00
Chris Lattner
d91d86f3a6 * No longer need lowerallocation pass
* Add X86 Stackifier pass
* Add peephole optimizer pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5233 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:51:23 +00:00
Chris Lattner
a849056a37 rename FP -> fp*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5232 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:50:46 +00:00
Chris Lattner
d264bec88a * Move frame and constant pool indexes to first argument of memory reference
so we can put an offset in there as well...
* Fix long/ulong stuff


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5231 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:50:33 +00:00
Chris Lattner
0c514f4e27 * Some instructions take 64 bit integers, add an Arg type for it
* Add flags for different types of FP pseudo instrs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5230 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:49:24 +00:00
Chris Lattner
20862b970e * Function calls clobber fp registers
* Use new M_TERMINATOR_FLAG flag
* Add ::Void flag on several instructions so def-use info is correct!
* Implement MANY FP instructions
* Finalize pseudo FP instructions
* Add set of Pseudo FP instruction description flags
* Add support for MOVim instrs
* Add support for 64 bit support instrs, like adc sbb, etc
* Add conditional move


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5229 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:48:46 +00:00
Chris Lattner
987e8baf12 Add support for frame and constant pool references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5228 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:45:53 +00:00
Chris Lattner
31ad5dd67f Move passes out to Passes.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5227 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:45:29 +00:00
Chris Lattner
70445403c3 Add speculation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5226 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:35:08 +00:00
Chris Lattner
b708944fc2 * Implement rudimentary output of the constant pool
* Implement support for MRMS?m instructions
* Add Arg64 support
* Add support for frame indexes and constant pool indexes
*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5225 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:35:03 +00:00
Chris Lattner
e831b6b802 * Add support for FP registers ST*
* Add support for the constant pool & constant pool indices
* Add support for MRMS?m instructions
* Fix FP Prefix emission
* Add support for global addresses and external symbols


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5224 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:33:59 +00:00
Chris Lattner
3e130a2a77 * Adjust to use new interfaces, eliminating CurReg stuff
* Support arbitrary FP constants
* Fix bugs in frame layout for function calls and incoming arguments
* Insert copies for constant arguments to PHI nodes into the BOTTOM of
  predecessor blocks, not the top.
* Implement _floating point_ support: setcc, return, load, store, cast
* Fix several bugs in the cast instruction
* Abstract out call emission and load/store for FP
* Implement malloc/free without previous lowering pass.
* Make use of new forms of MachineOperand
* Implement _long_ support!
* Fix many bugs in FP support
* Change branch from je/jne to je/jmp
* Simplify code generated for GEP instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5223 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:32:26 +00:00
Chris Lattner
d0f166a486 More renamings of Target/Machine*Info to Target/Target*Info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5204 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-29 03:13:05 +00:00
Chris Lattner
f27eeea54f Rename MachineOptInfo to TargetoptInfo
Rename MachineCacheInfo to TargetCacheInfo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5203 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-29 02:50:35 +00:00
Chris Lattner
aa09b75d22 Rename FunctionFrameInfo to MachineFrameInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5201 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 21:08:28 +00:00
Chris Lattner
8bd66e6907 Rename MachineFrameInfo to TargetFrameInfo.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5199 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 21:00:25 +00:00
Chris Lattner
fde4b51baa Implement the TargetFrameInfo interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5189 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:33:52 +00:00
Chris Lattner
d282cfef61 * Initialize new FrameInfo member
* most pass ctors no longer take TM arguments
* New prolog/epilog insertion pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5188 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:33:32 +00:00
Chris Lattner
128aff4f95 Changes to match new MRegisterInfo api
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5187 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:32:54 +00:00
Chris Lattner
3c1c03d7a7 *** Implement frame pointer elimination on X86!
* Include contents of X86RegisterClasses.cpp into here
* Adjustments to register api to work with new frame manager
* Eliminate moveImm2Reg, getFramePointer, and getStackPointer
* Cleanup and simplify prolog/epilog code generation
* Prolog/epilog are MUCH more efficient now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5186 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:32:28 +00:00
Chris Lattner
e0a3fcb304 Contents merged with X86RegisterInfo.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5185 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:30:15 +00:00
Chris Lattner
0ef73f3e29 * Remove implementations of previously pure virtual functions that are not any longer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5184 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:29:41 +00:00
Chris Lattner
3e6dd5009d * Minor reformatting
* Remove some size suffixes [bwl]
* Add new ADJCALLSTACKDOWN & ADJCALLSTACKUP pseudo instrs
* Call instructions are M_CALL not M_BRANCH!
* Disable push and pop instructions
* Add new ANDri32 instr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5183 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:29:14 +00:00
Chris Lattner
a1826c2ecd New addFrameReference function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5182 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:26:58 +00:00
Chris Lattner
f2ab4124e3 * Most pass ctor functions don't take TM arguments anymore
* New createPrologEpilogCodeInserter() function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5181 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:26:16 +00:00
Chris Lattner
0285a33761 * Convert to a MachineFunctionPass
* Don't take a TM as a ctor parameter
* Print [X - Y] instead of [X + -Y] when possible


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5180 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:25:38 +00:00
Chris Lattner
5ae99fe3bf * Convert to a MachineFunctionPass
* ctor doesn't take TM argument
* handle direct ESP references correctly!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5179 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:24:48 +00:00
Chris Lattner
065faebe10 * Use the new Abstract Frame Manager to handle incoming arguments and
fixed size allocas
* Revamp call emission to work with new frame manager


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5178 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-28 20:24:02 +00:00
Chris Lattner
94af414b71 * Simplify Value classes
* Add initial support for FP constants
* Add initial FP support for several instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5154 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-25 05:13:53 +00:00
Chris Lattner
6331bdb940 * Use new pseudo instr form for instructions
* Mark CALLpcrel as a RawFrm instruction as required
* Eliminate invalid BSWAP16 instruction
* Add xchg instructions
* Add initial support for FP instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5153 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-25 05:11:46 +00:00
Chris Lattner
4c299f5da1 Add FP instr prefix byte support
Add Pseudo instr class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5152 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-25 05:09:59 +00:00
Chris Lattner
5ada8df488 Add support for FP prefixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5151 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-25 05:09:21 +00:00
Chris Lattner
eca1f639eb Add printer support for Pseudo instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5150 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-25 05:09:01 +00:00
Chris Lattner
ba4ef26245 Initial support for FP registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5149 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-25 05:08:03 +00:00
Chris Lattner
8e58179048 New simpler spill interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5148 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-25 05:07:09 +00:00
Chris Lattner
6811c6e1d7 Adjustments to match new simpler spill interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-25 05:06:43 +00:00
Chris Lattner
430cda7452 Free machine code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5146 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-25 05:06:21 +00:00
Chris Lattner
5bcd95c57f Changes to allow for a configurable target machine that allows big endian and/or long pointer operation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5131 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-24 00:04:01 +00:00
Chris Lattner
e8f0d924d4 Changes to compile with GCC 2.96
Changes to support configurable pointer size and endianness


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5130 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-24 00:03:11 +00:00
Chris Lattner
fc1c705965 Fix compilation on gcc 2.96
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5116 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-23 23:46:55 +00:00
Chris Lattner
25f091fc61 Add definition for the bswap instruction
*** FIX: the encoding of the SUB instruction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5115 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-23 23:46:31 +00:00
Chris Lattner
facc9fb9ba Add support for the bswap instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5114 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-23 23:46:00 +00:00
Chris Lattner
6eaa46956a Fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5109 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-20 04:13:28 +00:00
Chris Lattner
45a4399f88 CBW doesn't modify AL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5108 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-20 04:13:11 +00:00
Chris Lattner
df642e1fd6 fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5107 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-20 04:12:48 +00:00
Chris Lattner
89fab07abd Don't force setCC instructions into AL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5104 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-18 01:44:31 +00:00
Chris Lattner
b339223518 Add comments, switch uses/defs to match InstrInfo.def file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5102 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-18 01:05:54 +00:00
Chris Lattner
1445895e19 Add reg clobber list for direct calls
Represent empty use/def list as a null pointer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5101 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-18 01:05:31 +00:00
Chris Lattner
79de6319b1 Update to use new interface for register info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5098 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-17 04:19:17 +00:00
Chris Lattner
3bbe7cc51d Round number of bytes allocated on the stack up to a multiple of 4 so that the
stack remains aligned


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5095 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-17 03:15:26 +00:00
Chris Lattner
14322cd337 Local register allocator is now stable enough for use, it passes all tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5094 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-17 02:51:15 +00:00
Chris Lattner
6c6cf873f3 Register allocator is responsible for spilling callee saved regs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5092 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-17 02:48:57 +00:00
Chris Lattner
3bd9409349 Build add instructions of the correct form!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5090 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 23:36:57 +00:00
Chris Lattner
14aa7fe238 Two fixes:
* Only load incoming arguments into virtual registers once at the
    beginning of the function
  * Assign different virtual registers to each reference to constants/globals


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5088 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 22:54:46 +00:00
Chris Lattner
3fc14c2602 Fix prolog/epilog in the presence of alloca
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5087 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 22:29:30 +00:00
Chris Lattner
4863fe14de Make sure stack manipulation refers to ESP the right number of times
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5086 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 22:29:06 +00:00
Chris Lattner
8a307e8c63 Add some special cases to make common getelementptr cases easier to read/faster
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5084 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 19:32:50 +00:00
Chris Lattner
27177cb1c1 Finish implementation of alias list impl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5083 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 19:31:48 +00:00
Chris Lattner
439a27ac42 Add mechanism to select register allocator to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5079 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 16:15:51 +00:00
Chris Lattner
92aec04cd6 Try #2 to get alias set stuff to work
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5077 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 16:14:51 +00:00
Chris Lattner
1894dd6ca9 Add comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5076 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 15:57:44 +00:00
Chris Lattner
c2fc7ea60b Add info about register aliases, add prototype for createLocalRegisterAllocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5075 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 15:55:51 +00:00
Chris Lattner
dfb0a541c7 Add info about register file aliasing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5074 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 15:55:25 +00:00
Chris Lattner
1a49517a2c Add information about register file aliasing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5073 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 15:54:59 +00:00
Chris Lattner
880eaa5985 Add call clobber info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5072 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 15:54:42 +00:00
Chris Lattner
1a45626c4c Rename createSimpleX86RegisterAllocator to createSimpleRegisterAllocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5071 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 14:38:13 +00:00
Brian Gaeke
68b1edca76 brg
Fix some bugs in use of MBB vs. BB and iterators that are invalidated before
we use them.

Reference targetClass by enum name, not by number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5069 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-16 04:23:29 +00:00
Chris Lattner
f4b95d94e2 Correct the setting of Def flags on registers that are modified!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5065 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 22:38:47 +00:00
Chris Lattner
f0eb7beb66 Give passes nice names!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5059 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 21:13:40 +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
afe628c1d6 Changes to make new TargetRegisterClass interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5050 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 19:29:34 +00:00
Chris Lattner
439b76730d * Simplify TargetRegisterClass implementations
* Change regclass iterators to use an extra level of pointers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5047 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 18:40:36 +00:00
Chris Lattner
6b993ccfe5 Add support to cast from a bool type
Add support for boolean constants
add getClassB method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5034 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 08:02:15 +00:00
Chris Lattner
d909683591 Use MachineOperand::isFoo methods instead of our own global functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5033 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 08:01:39 +00:00
Chris Lattner
6e49a4b814 Implement indirect function calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5024 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 14:13:27 +00:00
Misha Brukman
b8ead9dc22 Make function code generation printing debug-only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5023 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 13:16:14 +00:00
Chris Lattner
202a2d0e17 Fix bork in doMultiply
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5021 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 13:07:42 +00:00
Chris Lattner
d7d3872fb0 Add sanity checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5020 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 13:04:04 +00:00
Misha Brukman
87e369d221 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5017 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 12:00:06 +00:00
Chris Lattner
920536333c Insert phi code at top of block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5015 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 11:52:34 +00:00
Brian Gaeke
992447f91b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5014 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 11:39:18 +00:00
Chris Lattner
7d25589ee1 Implement cast bool to X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5012 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 11:31:59 +00:00
Brian Gaeke
71794c0069 Rename all BMI MachineBasicBlock operands to MBB.
Try to mess around with emitGEPOperation's elementSizeReg to make it work,
again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5011 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 11:22:48 +00:00
Chris Lattner
f08ad9f817 Finish up iterator stuph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5009 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 10:50:40 +00:00
Misha Brukman
fa18ade05b Treat longs as ints => pretend they're all 32-bit values and squeeze them into
32-bit registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5008 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 10:43:09 +00:00
Chris Lattner
333b2fa560 Code gen phi's correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5004 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 10:09:43 +00:00
Chris Lattner
3faae2dbc2 Print X86 PHI nodes in a sane manner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5003 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 09:59:26 +00:00
Misha Brukman
2b46e8eccc Added moveReg2Reg() and moveImm2Reg() to accomodate moving data around due to
PHI nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5001 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 09:54:12 +00:00
Brian Gaeke
ed6902ca89 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4999 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 09:28:50 +00:00
Brian Gaeke
95780cccef 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4998 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 07:56:18 +00:00
Chris Lattner
c0812d8f39 Implement getelementptr constant exprs
Implement ConstantPointerRefs
Treat long/ulongs as if they were integers.  A hack, but an effective one


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4995 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 06:56:29 +00:00
Brian Gaeke
e48ec018a5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4994 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 06:46:31 +00:00