Commit Graph

638 Commits

Author SHA1 Message Date
Chris Lattner
c58c169eda Instead of hacking in custom support for Invoke/Unwind, use the LowerInvoke pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8871 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-05 19:15:47 +00:00
Alkis Evlogimenos
7237ecef13 Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8819 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 16:57:49 +00:00
Alkis Evlogimenos
eed462b685 Change llc command line for register allocators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8815 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 06:13:19 +00:00
Alkis Evlogimenos
77e78d050a Revert previous change. For some reason this went into the main branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8805 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-01 19:40:13 +00:00
Alkis Evlogimenos
6ac2c8c673 Added command line option for linear scan allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8804 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-01 19:38:10 +00:00
Chris Lattner
b787e13e73 Be a little more specific about what is begin generated. Only print
command line if VERBOSE=1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8453 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 19:52:54 +00:00
Chris Lattner
b3aad5d28f Only emit inter-field-padding if the amount of padding is != 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8452 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 19:52:24 +00:00
John Criswell
410d1b5dea Updated to find source files using VPATH. This makes writing build rules
much cleaner and easier.
Labeled .td as a suffix for tblgen files in Makefile.rules.
Modified build rules so that source files generated during the build are placed
in the build directory and not the source directory (and not in a Debug
directory).  This makes the system cleaner and allows us to have a read-only
source tree.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8424 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 20:57:03 +00:00
Chris Lattner
ad20071559 * Simplify printConstantValueOnly by moving the tail padding stuff directly
into the struct case.
* Extend printConstantValueOnly to print .zero's if the initializer is zero
* Delete dead isConstantFunctionPointerRef function
* Emit the appropriate assembly for the various linkage types!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8417 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 16:23:36 +00:00
Chris Lattner
ee5457cbe8 Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8411 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 19:44:26 +00:00
Chris Lattner
36143fc444 Add support for the unwind instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8408 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:54:55 +00:00
John Criswell
69077e28d7 Checkin of autoconf-style object root.
Adjusted Makefile to work with new autoconf-style object root.
Specifically, use the new -I option of tblgen to find include files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8379 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-06 14:50:22 +00:00
Chris Lattner
b7f7296cd9 OptInfo is no longer required
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:41:07 +00:00
Chris Lattner
aeb54b882c Add support for the llvm.unwind intrinsic, which we codegen to just do an abort
until we implement unwinding.
Add support for the invoke instruction, which codegens just like a call with
a branch after it.

The end effect of this change is that programs using the invoke instruction,
but never unwinding, will work fine.  Programs that unwind will abort until
we get unwind support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8187 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 21:23:43 +00:00
Chris Lattner
bb144a892b Targets should configure themselves based on a Module, not some wierd flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8132 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:49:48 +00:00
Chris Lattner
58c41fe687 Implement: Jello/test-constantexpr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8127 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:19:47 +00:00
Chris Lattner
f3526e2207 Change all #include'd files to be :: rules instead of : rules
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8019 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 20:37:17 +00:00
Chris Lattner
72af6b8e5d Add support for the sig(set|long)jmp intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7951 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 16:06:09 +00:00
Misha Brukman
5560c9d49c Spell `necessary' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 14:43:39 +00:00
Chris Lattner
7540565863 Fix ABI issue: Longs really do need to be only 4 byte aligned on X86.
This bug caused miscompilation of programs using 'struct stat', but only if
compiled with support for 64-bit filesystems.  This could in theory effect
other things, but only if the LLVM code shared data structures with native code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7928 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-17 23:20:40 +00:00
Chris Lattner
f3c274d4a6 Adjust to new API, add expandCall stub
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7873 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 04:51:59 +00:00
Chris Lattner
51970b2734 Add support for unconditional branches and for emitting JE instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7872 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 04:50:49 +00:00
Brian Gaeke
3e3c805a82 X86 static backend: smacked
Function at a time: smacked

Who you gonna call!!!  :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7826 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 19:02:09 +00:00
Brian Gaeke
19df3876e6 Factory methods for FunctionPasses now return type FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7823 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:18:15 +00:00
Brian Gaeke
8844a0ba89 addPassesToJITCompile and addPassesToEmitMachineCode now take a
FunctionPassManager, to support function-at-a-time compilation and
 emission of code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7821 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:17:27 +00:00
Brian Gaeke
b428654076 addPassesToJITCompile now takes a FunctionPassManager, to support
function-at-a-time compilation and emission of code.
Separate addPassesToEmitAssembly from addPassesToJITCompile, because
 the latter requires you to use FunctionPasses, and the former might
 diverge anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7817 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:15:52 +00:00
Brian Gaeke
9826bdb7d8 Factory methods for FunctionPasses now return type FunctionPass *.
Correct one of the functions' comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7816 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:15:29 +00:00
Brian Gaeke
9d99b43fbc Factory methods for FunctionPasses now return type FunctionPass *.
Revert (to v1.55) one of the hunks of Chris's change that messed up the
 %-register workaround.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7815 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:15:15 +00:00
Brian Gaeke
99c27d7686 Just incorporating some notes I wrote for myself into a place where they won't
get lost...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7798 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 00:30:48 +00:00
Chris Lattner
00b40943ab Add basic support for 16 and 32 bit function arguments!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7755 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 21:30:00 +00:00
Chris Lattner
d59414fc85 Sort #includes, eliminate #include of "llvm/Type.h" which was redundant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7746 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 20:06:16 +00:00
Chris Lattner
67488a9236 Cygwin apparently works with %'s on registers!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7745 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 20:04:57 +00:00
Chris Lattner
2bcee3400f Whoops, accidental checkin. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7743 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 19:35:46 +00:00
Chris Lattner
93c1afacd1 Add a new -enable-cygwin-compatible-output argument, which make the output more
consumably by the cygwin assembler.  This is really just a nasty hack until we
get real target triple support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7742 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 19:35:26 +00:00
Brian Gaeke
2a09877519 Print % signs before register names; turn off "noprefix" mode in gas output.
Fixes test case test/Programs/LLVMSource/2003-08-03-ReservedWordGlobal.ll.

Also: Refactor implicit-uses printing into its own method.
Remove a couple of unused variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7737 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 19:05:46 +00:00
Chris Lattner
e7e33c0543 Add (ret int) expander so that we can at least write testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7730 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 15:48:00 +00:00
Misha Brukman
bf2f8a9963 Converted tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7728 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 15:38:50 +00:00
Misha Brukman
859e5cc1f7 Removed `-debug' so that spurious printouts of patterns are not seen at
compilation time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7727 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 15:30:20 +00:00
Chris Lattner
b84fe1c636 Add patterns for multiply, and, or, and xor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7725 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 15:23:25 +00:00
Chris Lattner
2aa3a66fb1 Until the pattern matching instruction selector is finished, enable debug output from it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7722 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 15:11:01 +00:00
Chris Lattner
ac0c8680ad Add support for a pattern matching instruction selector. This is still in
the early implementation phases, so it is disabled by default


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7719 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 14:59:22 +00:00
Chris Lattner
69666e552e This register is never used, disable it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7661 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 04:49:16 +00:00
Chris Lattner
2959b6ec49 Completely eliminate the isVoid TSFlag, shifting over all other fields
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7636 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 15:32:20 +00:00
Chris Lattner
d87b59c866 add a pattern for RET, immediates no longer need to be explicitly typed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7635 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 15:31:35 +00:00
Chris Lattner
c9bbfbc04e Factor shared code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7600 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 16:34:44 +00:00
Chris Lattner
02beda1221 This is the real fix for the previous register allocator problem.
Physical registers should not float around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7587 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 00:48:47 +00:00
Chris Lattner
0bfd186db0 Add patterns for (mov R, R) (mov R, I) and subtracts. The moves are to enable
testing, the subtracts are because I was in the neighborhood.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7581 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 21:18:19 +00:00
Chris Lattner
c34921dc6a Change comments into something that TableGen can read!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7580 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 21:08:29 +00:00
Chris Lattner
6770aedf7f Rename register classes to be upper case to make it obvious that they are X86
specific in the tree patterns


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7578 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 20:58:29 +00:00
Chris Lattner
e5bb2d94d9 There is nothing special about noops anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7568 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 05:11:37 +00:00
Chris Lattner
c8f4587efd transition to using let instead of set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7564 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 04:59:56 +00:00
Chris Lattner
5e2cb8b991 Fix Bug: test/Regression/Jello/2003-08-03-CallArgLiveRanges.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7558 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 02:12:48 +00:00
Chris Lattner
72feb15563 Simplify some constant expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7556 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 01:04:59 +00:00
Chris Lattner
d587a84197 Remove illegal, unsupported escapes. This fixes program: Ptrdist-bc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7552 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 23:42:17 +00:00
Chris Lattner
e012132028 * Sort #includes, remove dupliates
* Use .zero to emit padding between struct elements
* Emit .comm symbols when we can, this dramatically reduces the amount of gunk we have to print
* Print global variable identifiers next to initializer more nicely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7551 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 23:37:09 +00:00
Chris Lattner
7af9a38d0f Specify custom name for registers to get the ()'s in the name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7547 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 22:12:47 +00:00
Chris Lattner
8d44ba8c5c Start using tablegen'd instruction enum list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7542 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:57:05 +00:00
Chris Lattner
113455be9d Resort tables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7541 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:56:36 +00:00
Chris Lattner
4d18d5ce1e Lump the base opcode in with the X86 TargetSpecific flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7540 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:56:22 +00:00
Chris Lattner
abf05b2dae * Start using tablegen'd instruction descriptions
* Fix bug in the createNOP method, which was not marking the operands of the
  generated XCHG as useanddef.  I don't think this method is actually used,
  so it wasn't breaking anything, but it should be fixed anyway...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7539 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:55:55 +00:00
Chris Lattner
c01f39307e Start using tablegenerated instruction descriptions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7538 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:54:59 +00:00
Chris Lattner
1cca5e3a29 Add new TableGen instruction definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7537 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:54:21 +00:00
Chris Lattner
5302e28adb Remove the old .def file, it is now obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7536 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:54:06 +00:00
Chris Lattner
cb53358778 Set debug types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7532 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:14:38 +00:00
Chris Lattner
b77eb78afc Add Target class for X86 target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7523 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 18:19:37 +00:00
Chris Lattner
9eab316528 The RegisterInfo class is obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7522 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 18:18:48 +00:00
Chris Lattner
a67697867d Tell CVS to ignore all .inc files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7513 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:50:17 +00:00
Chris Lattner
832003578e Switch over to tablegen generated header files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7512 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:48:55 +00:00
Chris Lattner
7ad3e063f5 Switch over to TableGen generated register file description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7511 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:48:14 +00:00
Chris Lattner
762fb5f704 Initial checkin of X86.td file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7510 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:47:49 +00:00
Chris Lattner
b76d6fc4d5 Initial checkin of X86 Register File description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7509 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:47:25 +00:00
Chris Lattner
09ce077a2d Fix typeos in comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7505 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 13:50:14 +00:00
Chris Lattner
a11136b16c Move DEBUG to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7497 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:21:34 +00:00
Chris Lattner
7296fb0421 This method is long dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7460 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 03:48:42 +00:00
Chris Lattner
b08f3dfe50 Remove more obsolete comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7455 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 17:56:05 +00:00
Misha Brukman
f31dc9841c Changed pointer to the JIT code to its current location, under LLI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7454 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 17:50:35 +00:00
Brian Gaeke
002a50ac64 I think local symbols in X86 GAS have to start with .L, not just
.; so I have changed the basic block markers to start with .L.  I also
broke up a >80char line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7452 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 17:38:52 +00:00
Chris Lattner
7db1fa9802 Use target specific interface instead of forcing it to be target-generic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7413 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 05:33:48 +00:00
Chris Lattner
c8c377d111 Move "register flags" definition the type of registers to be fully fledged
value types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7377 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 05:14:16 +00:00
Chris Lattner
d281de2181 Rename function to be more consistent with filename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7352 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:49:58 +00:00
Chris Lattner
dee1263c7c We don't modify the LLVM rep, remain const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7345 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:06:00 +00:00
Chris Lattner
2a865b015b If the pass changes _anything_ it must return true
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7344 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:05:37 +00:00
Brian Gaeke
d9fb37ac98 Use unified CWriter-X86/Printer name mangler. Do not bother using
SlotCalculator in CWriter.  (Unfortunately, all this means a lot of
X86/Printer's methods have to be de-constified again.  Oh well.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7299 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 20:20:44 +00:00
Brian Gaeke
3d8d9f7e72 It doesn't appear that we need to #include these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7291 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:48:53 +00:00
Brian Gaeke
b3011a01b5 Constify most methods. We could have constified doInitialization and
doFinalization too except that would have made them shadow, not override,
the parent class :-P.

Allow *any* constant cast expression between pointers and longs,
or vice-versa, or any widening (not just same-size) conversion that
isLosslesslyConvertibleTo approves. This fixes oopack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:30:45 +00:00
Brian Gaeke
de420aee32 Printer.cpp: Ditch addRequired/getAnalysis, because they leave
Printer::doFinalization() out in the cold.  Now we pass in a TargetMachine
  to Printer's constructor and get the TargetData from the TargetMachine.
 Don't pass TargetMachine or MRegisterInfo objects around in the Printer.
 Constify TargetData references.
X86.h: Update comment and prototype of createX86CodePrinterPass().
X86TargetMachine.cpp: Update callers of createX86CodePrinterPass().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7275 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 20:25:08 +00:00
Brian Gaeke
92bdfe6951 Add, rewrite, and/or reformat many comments.
Stop passing ostreams around: we already have one perfectly good ostream
and we can all share it.

Stop stashing a pointer to TargetData in the Pass object, because that will
lead to a crash if there are no functions in the module (ouch!)  Instead,
use addRequired() and getAnalysis(), like we always should have done.

Move the check for ConstantExpr up before the check for isPrimitiveType,
because we need to be able to catch e.g. ubyte (cast bool false to ubyte),
whose type is primitive but which is nevertheless a ConstantExpr, by calling
our specialized handler instead of the AsmWriter. This would result in
assembler errors when we would try to output something like ".byte (cast
bool false to ubyte)".

GC some unused variable declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7265 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 18:37:06 +00:00
Chris Lattner
c07736a397 Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:22:26 +00:00
Brian Gaeke
d461505efd Please, save your applause^H^H^H^H^H^H^H^Hflames for the end...
Avoid a fall-through in the (stubby) treatment of the longjmp intrinsic
call which causes llc & lli to core-dump.

Add a sort-of treatment of cast double to ulong. I am not really sure
what a user should expect to see upon casting a negative FP value to
unsigned long long. But with what is given here, I was able to write
a program that could cast -123.456 to ulong and back and get -123.0,
which seems like a step in the right direction.  GCC seems to give you
0. I don't know if I'd consider that useful.

These cases were coming up in GNU coreutils-5.0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7205 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-18 20:23:43 +00:00
Brian Gaeke
bfedb912cd Use getClassB for load and store; we don't want to abort when we
try to load or store through a bool*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7195 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-17 21:30:06 +00:00
Brian Gaeke
0517c5ac92 If we have a constant pointer reference to a function, we were printing
out the entire llvm disassembly for the function at global constant-output
time, which caused the assembler to barf in 164.gzip. This fixes that
particular problem (though 164.gzip has other problems with X86 llc.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7168 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-11 21:57:01 +00:00
Brian Gaeke
1aa476edf0 Fix some serious floating-point bugs (fixes test cases such as Oscar,
Fhourstones, McCat-vor, and many others...)

Printer.cpp: Print implicit uses for AddRegFrm instructions.  Break gas
bug workarounds up into separate stanzas of code for each bug.  Add new
workarounds for fild and fistp.

X86InstrInfo.def: Add O_ST0 implicit uses for more FP instrs where they
obviously apply. Also add PrintImplUses flags for FP instrs where they
are necessary for gas to understand the output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7165 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-11 18:18:35 +00:00
Brian Gaeke
b44210d768 Insert workaround for GAS bug in assembling FLD/FSTP XWORD PTR [...]
instructions, by outputting them as bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7115 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 18:34:20 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Chris Lattner
eb093fbf6f Setjmp should always return zero if we don't implement longjmp. This avoids
leaving trash in the register, fixing anagram


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7013 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 19:35:54 +00:00
Chris Lattner
c151e4f415 Until there is a setjmp/longjmp transformation pass, codegen setjmp as a noop
and longjmp as an abort!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6977 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 16:42:32 +00:00
Brian Gaeke
d7908f679e Nice tasty llc fixes. These should fix LLC for x86 for everything in
SingleSource except oopack and Oscar.  (Sorry, Oscar.)

include/llvm/Target/TargetInstrInfo.h: Remove virtual print method. Add
 accessors for ImplicitUses/Defs.
lib/Target/TargetInstrInfo.cpp: Remove virtual print method. If you
 really wanted this, just use MI->print(O, TM); instead...
lib/Target/X86:
FloatingPoint.cpp: ...like this.
X86InstrInfo.h: Remove virtual print method. Define the PrintImplUses
 target-specific flag bit.
X86InstrInfo.def: Add the PrintImplUses flag to all the instructions
 which implicitly use CL, because the assembler needs to see the CL in
 order to generate the right instruction.
Printer.cpp: Ditch fnIndex at Chris's request. Now we use CurrentFnName
  to name constants in the constant pool for each function instead. This
  avoids keeping state between runOnMachineFunction() invocations, which
  is a no-no. Having MangledGlobals be global is a bogon I'd like to get
  rid of too, but making it a static member of Printer causes link errors
  (why???).
 Make NumberForBB into a member of Printer instead of a global, too.
 Make printOp and printMemReference into methods of Printer.
 X86InstrInfo::print is now Printer::printMachineInstruction, because
  TargetInstrInfo::print is history. (Because of this, we have to qualify
  the names of some TargetInstrInfo methods we call.)
 Print out the ImplicitUses field of any instruction we print that has
  the PrintImplUses bit set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6924 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-27 00:00:48 +00:00
Brian Gaeke
5e00157c5a Number constants from constant pool as CPIf_i where f is the function index
and i is the constant pool index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6920 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 18:02:30 +00:00
Brian Gaeke
bc601fe3e7 Integrate the C writer's name mangler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6908 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 22:00:39 +00:00
Brian Gaeke
01d79ff86d First draft of X86 LLC backend. This should be OK for small programs like
Shootout, but it has some issues with bigger programs. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6907 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 18:01:07 +00:00
Chris Lattner
7b52c036f4 Do not use the inefficient, fixed function, CBW, CDQ, ... instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6844 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:31:18 +00:00
Chris Lattner
034acf0a3d Minor simplification to 64-bit instsel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6831 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 18:15:27 +00:00
Chris Lattner
0f1c461423 For 16 and 32-bit multiplies, use the IMUL instruction instead of the MUL instruction.
This allows us to not force the use of the EAX/AX registers!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6830 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 17:16:58 +00:00
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
Chris Lattner
2067184b42 Emit the right form of mod/rm mod field
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4986 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 05:05:05 +00:00
Chris Lattner
276867de18 Nicify a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4985 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 05:04:37 +00:00
Chris Lattner
b1224f2d0b Fix encoding of CBW instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4983 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 04:41:31 +00:00
Misha Brukman
07e376bd0d Moves now select correct opcode based on the data size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4981 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 04:24:53 +00:00
Chris Lattner
95b12ba775 Remove extranous #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4980 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 04:12:24 +00:00
Chris Lattner
a0f38c867c Rename MemArg* to Arg*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4979 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 03:51:55 +00:00
Chris Lattner
a6a382c5ca Make mem size an assert
Add mem size flags to all instructions using an imm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4978 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 03:50:13 +00:00
Misha Brukman
5000e43809 This is supposed to provide correct size for datatypes. Supposedly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4977 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-13 02:13:15 +00:00
Misha Brukman
9f32791fe7 Added the flag to mark instructions which are really 2-address instructions in
X86, but would be 3-address in any normail architecture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4974 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-12 23:19:11 +00:00
Brian Gaeke
20244b7e2c This checkin is brought to you by the brian gaeke allnighter fund.
(lib/Target/X86) InstSelectSimple.cpp:
 Include llvm/DerivedTypes.h and iostream.
 Refactor visitMul out into a wrapper around doMultiply(), so that we
  can do multiplications on temporary values when we are doing
  getelementptrs.
 Refactor part of getReg out into makeAnotherReg, so that we can create
  registers willy-nilly to hold temporary values, when we are doing
  getelementptrs.
 Add stub implementations of visitMallocInst and visitAllocaInst.
 Add initial implementation of visitGetElementPtrInst.
 In copyConstantToRegister:
  We throw a *lot* of our asserts here. So, when we want to throw an
   assert, print out to stderr whatever expr or whatever constant made
   us barf.
  Support copying ConstantPointerNull to register, using a move immediate
   of zero.
 Rename FLDr4 and FLDr8 to FLDr32 and FLDr64, so that they match the meanings
  of the numbers in the other instruction names. All uses modified.
 Teach visitCallInst to extract byte- and short-class return values
  from subregs of EAX.  Add a FIXME note about how we would do it for
  float-class return values.
 Add a FIXME note about how we would cast float to int and back.

X86InstrInfo.def:
 Rename FLDr4 and FLDr8 to FLDr32 and FLDr64, so that they match the meanings
  of the numbers in the other instruction names. All uses modified.

(tools/jello) GlobalVars.cpp:
 Include iostream.
 If we have to emit a floating-point constant to memory, gamble and use
  the same method as for ints.
 If we have to emit a ConstantPointerNull to memory, try using a "void *"
  and "NULL".
 Otherwise, if we are going to throw an assert, print out whatever constant
  made us barf, first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4973 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-12 15:33:40 +00:00
Brian Gaeke
d474e9cdce Implement a lot of cast functionality (no FP or 64)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4944 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-06 10:49:33 +00:00
Brian Gaeke
86764d778e Target/X86/Printer.cpp: Add sizePtr function, and use it instead of
" <SIZE> PTR " string when emitting assembly.

Target/X86/X86InstrInfo.def: Tidy up a bit:
 Squashed everything down to 118 chars wide, wrapping lines so that
 comment is at the same point on each line. Rename "NoImpRegs" as
 "NoIR". (most instructions have NoImpRegs twice on a line, so this
 saves 10 columns).

 Also, annotate various instructions with flags for size of memory operand.
  (MemArg16, MemArg32, MemArg64, etc.)

Target/X86/X86InstrInfo.h: Define flags for size of memory operand.
 (MemArg16, MemArg32, MemArg64, etc.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4932 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-05 08:30:40 +00:00
Misha Brukman
2adb3959f6 Implemented functions for emitting prologues and epilogues;
removed EBP from the list of callee-saved registers (it isn't one).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4929 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 23:57:03 +00:00
Misha Brukman
1f283ef3e5 Added push and pop instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4928 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 23:56:26 +00:00
Chris Lattner
4fa1acc945 Fix handling of function calls that return void
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4925 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 23:50:28 +00:00
Chris Lattner
a324364f04 Implement initial support for return values from call instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4924 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 23:45:28 +00:00
Misha Brukman
0d2cf3a533 Adjust the stack pointer after a function call, proportional to the number of
arguments pushed onto the stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4922 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 19:22:53 +00:00
Misha Brukman
a17a2ac727 Added instructions to add/subtract imm32 to/from a reg32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4921 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 19:15:22 +00:00
Chris Lattner
ac573f61b4 Fix bogus assertion failures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4919 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 17:32:52 +00:00
Chris Lattner
6d66944388 Avoid bad assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4918 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 17:28:40 +00:00
Chris Lattner
93689114a5 Remove think-o assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4917 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 17:18:30 +00:00
Chris Lattner
d6c4cfab54 Avoid crashing on Arguments, just silently miscompile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4916 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 17:15:34 +00:00
Misha Brukman
a361c8417b storeReg2RegOffset() and loadRegOffset2Reg() now take the iterator by value
instead of by reference, since they return the modified iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4914 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 17:14:13 +00:00
Misha Brukman
0af0d5bd3e Moved buildReg2RegClassMap() into from X86RegisterInfo to MRegisterInfo, since
it is target-independent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4911 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 16:47:04 +00:00
Chris Lattner
504c411e81 Add a "Lazy Function Resolution in Jello" section
Remove some todo's


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4910 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 16:12:54 +00:00
Chris Lattner
33ced56edb Fix a bug I introduced in a previous change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4909 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 06:56:56 +00:00
Chris Lattner
dbf30f7b02 Add support for referencing global variables/functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4907 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-04 06:45:19 +00:00
Misha Brukman
03c6fafd05 Added support for callee- and caller-save registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4897 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 23:11:21 +00:00
Chris Lattner
e8e6743cb7 Fix broken ret opcode, grr...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4895 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 22:50:02 +00:00
Chris Lattner
d852c15546 Fix instsel for calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4891 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 20:30:12 +00:00
Chris Lattner
f18a36e398 Fix the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4884 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 18:15:59 +00:00
Brian Gaeke
07f02614f6 brg
Add support for cast ... to bool in visitCastInst (it's a start, anyways...)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4883 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 07:36:03 +00:00
Chris Lattner
ea1ddab58e Split the machine code emitter completely out of the printer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4882 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 06:34:06 +00:00
Chris Lattner
4ce42a776a * Move information about Implicit Defs/Uses into X86InstrInfo.def.
* Expose information about implicit defs/uses of register through the
  MachineInstrInfo.h file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4877 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 05:42:53 +00:00
Brian Gaeke
bb25f2f08d brg
X86Implicit.cpp, X86Implicit.h: New files.
InstSelectSimple.cpp: Add some clarifications in visitCallInst comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4874 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 00:51:09 +00:00
Chris Lattner
8f04b0981f More support for machine code emission: raw instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4872 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:56:18 +00:00
Chris Lattner
b0f99b90df Expose explicit type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4871 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:50:41 +00:00
Chris Lattner
76041ce515 Start implementing MachineCodeEmitter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4870 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:44:34 +00:00
Chris Lattner
4aff92860d Eliminate OtherFrm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4868 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:40:58 +00:00
Chris Lattner
a5855c829b Remove comment
Remove handling of OtherFrm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4867 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:40:46 +00:00
Chris Lattner
40ead95928 Initial support for machine code emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4866 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:24:12 +00:00
Misha Brukman
6877dd3fb0 Fix order of operands on a store from reg to [reg+offset].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4857 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:10:35 +00:00
Chris Lattner
f8bafe8fdb Add rawfrm flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4841 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-01 23:25:59 +00:00
Chris Lattner
a4978ccbcb Don't add implicit regs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4840 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-01 23:24:58 +00:00
Brian Gaeke
c2505985ce brg
InstSelectSimple.cpp: Refactor out conversion of byte, short -> int
  from visitReturnInst() to new method, promote32().
 Use it in both visitReturnInst() and visitCallInst().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4839 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-30 11:57:28 +00:00
Brian Gaeke
18a20212d9 brg
InstSelectSimple.cpp: First draft of visitCallInst method, handling
 int/float args.
X86InstrInfo.def: Add entries for CALL with 32-bit pc relative arg, and
 PUSH with 32-bit reg arg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4838 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-29 12:01:58 +00:00
Brian Gaeke
c11232a8c4 brg
InstSelectSimple.cpp: Add some comments that say what I'm going to do for
 calls and casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4832 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-26 10:43:30 +00:00