Chris Lattner
df24575c31
Do not use explicit casts that hide the dependence on Instruction being
...
annotable
llvm-svn: 12000
2004-02-29 19:02:26 +00:00
Chris Lattner
252e887094
Ugh, the old sparc backend attaches MachineCodeForInstruction annotations on
...
LLVM instructions. Because it contains an explicit cast, we didn't catch it.
I guess instruction's will be annotable for the duration of the sparcv9's
existence.
llvm-svn: 11999
2004-02-29 18:54:23 +00:00
Alkis Evlogimenos
e186d8eb2f
Add instruction name description.
...
llvm-svn: 11998
2004-02-29 18:44:03 +00:00
Alkis Evlogimenos
8d8f872b3d
Use correct template for SHLD and SHRD instructions so that the memory
...
operand size is correctly specified.
llvm-svn: 11997
2004-02-29 09:19:40 +00:00
Alkis Evlogimenos
10f4523e9a
Improve allocation order:
...
1) For 8-bit registers try to use first the ones that are parts of the
same register (AL then AH). This way we only alias 2 16/32-bit
registers after allocating 4 8-bit variables.
2) Move EBX as the last register to allocate. This will cause less
spills to happen since we will have 8-bit registers available up to
register excaustion (assuming we use the allocation order). It
would be nice if we could push all of the 8-bit aliased registers
towards the end but we much prefer to keep callee saved register to
the end to avoid saving them on entry and exit of the function.
For example this gives a slight reduction of spills with linear scan
on 164.gzip.
Before:
11221 asm-printer - Number of machine instrs printed
975 spiller - Number of loads added
675 spiller - Number of stores added
398 spiller - Number of register spills
After:
11182 asm-printer - Number of machine instrs printed
952 spiller - Number of loads added
652 spiller - Number of stores added
386 spiller - Number of register spills
llvm-svn: 11996
2004-02-29 09:17:01 +00:00
Alkis Evlogimenos
7ecfe0a839
A big X86 instruction rename. The instructions are renamed to make
...
their names more decriptive. A name consists of the base name, a
default operand size followed by a character per operand with an
optional special size. For example:
ADD8rr -> add, 8-bit register, 8-bit register
IMUL16rmi -> imul, 16-bit register, 16-bit memory, 16-bit immediate
IMUL16rmi8 -> imul, 16-bit register, 16-bit memory, 8-bit immediate
MOVSX32rm16 -> movsx, 32-bit register, 16-bit memory
llvm-svn: 11995
2004-02-29 08:50:03 +00:00
Brian Gaeke
8303cb575e
Remove dead member variables of SparcV9SchedInfo and TargetSchedInfo
...
llvm-svn: 11994
2004-02-29 08:40:03 +00:00
Chris Lattner
a7db4ff17a
Eliminate the X86-specific BMI functions, using BuildMI instead.
...
Replace uses of addZImm with addImm.
llvm-svn: 11992
2004-02-29 07:22:16 +00:00
Chris Lattner
e8e0bafbba
Fix a miscompilation of 197.parser that occurs when you have single basic
...
block loops.
llvm-svn: 11990
2004-02-29 07:10:16 +00:00
Chris Lattner
bcc0df60ef
Fix PR255: [tailduplication] Single basic block loops are very rare
...
Note that this is a band-aid put over a band-aid. This just undisables
tail duplication in on very specific case that it seems to work in.
llvm-svn: 11989
2004-02-29 06:41:20 +00:00
Brian Gaeke
3d509f013e
Update comment at head of file. Also fix C 'typedef struct' nonsense I
...
inadvertently left in here.
llvm-svn: 11988
2004-02-29 06:33:28 +00:00
Chris Lattner
c2977ac665
Adjust to change in TII ctor arguments
...
llvm-svn: 11987
2004-02-29 06:31:44 +00:00
Chris Lattner
b5f0e162c7
Eliminate the distinction between "real" and "unreal" instructions
...
llvm-svn: 11986
2004-02-29 06:31:16 +00:00
Brian Gaeke
98a5cf6256
Add more architectures, and ELF64 stuff.
...
llvm-svn: 11985
2004-02-29 06:30:25 +00:00
Chris Lattner
cfc8f02250
These two virtual methods are never called.
...
llvm-svn: 11984
2004-02-29 05:59:33 +00:00
Chris Lattner
dd752eec34
Remove a TON of flags that noone cares about
...
llvm-svn: 11983
2004-02-29 05:58:30 +00:00
Chris Lattner
d80ff1bdc0
Noone calls these virtual methods
...
llvm-svn: 11982
2004-02-29 05:58:16 +00:00
Chris Lattner
dded7ad224
This is the only file in the system that uses this enum. eliminate it.
...
llvm-svn: 11981
2004-02-29 05:57:59 +00:00
Chris Lattner
e4db708a7c
Scrap a huge layer of cruft out of this interface.
...
llvm-svn: 11980
2004-02-29 05:57:21 +00:00
Chris Lattner
7cb71a20ca
Implement initial prolog/epilog code insertion methods.
...
llvm-svn: 11979
2004-02-29 05:18:30 +00:00
Chris Lattner
768b31fc77
Remove unneeded #include
...
llvm-svn: 11978
2004-02-29 05:15:56 +00:00
Chris Lattner
8b7ac81d2e
int64_t -> int
...
llvm-svn: 11977
2004-02-29 05:07:02 +00:00
Chris Lattner
34977159b3
Continue Alkis's int64_t cleanup. This makes all of the immediate related
...
methods take an int or unsigned value instead of int64_t.
Also, add an 'addImm' method to the MachineInstrBuilder class, because the
fact that the hardware sign or zero extends it does not/should not matter
to the code generator. Once the old sparc backend is removed the difference
can be eliminated.
llvm-svn: 11976
2004-02-29 05:06:49 +00:00
Chris Lattner
85dd74a158
Add BuildMI variants that take a MBB::iterator
...
llvm-svn: 11975
2004-02-29 04:55:28 +00:00
Alkis Evlogimenos
0f96b44e0e
Use correct template for ADC instruction with memory operands.
...
llvm-svn: 11974
2004-02-29 02:18:17 +00:00
Chris Lattner
800f720e7b
Add an instruction selector capable of selecting 'ret void'
...
llvm-svn: 11973
2004-02-29 00:27:00 +00:00
Alkis Evlogimenos
6815402082
SHLD and SHRD take 32-bit operands but an 8-bit immediate. Rename them
...
to denote this fact.
llvm-svn: 11972
2004-02-28 23:46:44 +00:00
Alkis Evlogimenos
e8dac99a43
Floating point loads/stores act on memory operands. Rename them to
...
denote this fact.
llvm-svn: 11971
2004-02-28 23:42:35 +00:00
Alkis Evlogimenos
1d71a15be9
Rename instruction templates to be easier to the human eye to
...
parse. The name is now I (operand size)*. For example:
Im32 -> instruction with 32-bit memory operands.
Im16i8 -> instruction with 16-bit memory operands and 8 bit immediate
operands.
llvm-svn: 11970
2004-02-28 23:09:03 +00:00
Alkis Evlogimenos
6038a89025
Uncomment instructions that take both an immediate and a memory
...
operand but their sizes differ.
llvm-svn: 11969
2004-02-28 22:06:59 +00:00
Brian Gaeke
7d5feb2b33
Fix my sloppiness
...
llvm-svn: 11968
2004-02-28 22:06:03 +00:00
Alkis Evlogimenos
f208a0fd81
Each instruction now has both an ImmType and a MemType. This describes
...
the size of the immediate and the memory operand on instructions that
use them. This resolves problems with instructions that take both a
memory and an immediate operand but their sizes differ (i.e. ADDmi32b).
llvm-svn: 11967
2004-02-28 22:02:05 +00:00
Brian Gaeke
d551a8b5fe
Fix typo in comment
...
llvm-svn: 11966
2004-02-28 21:55:18 +00:00
Chris Lattner
ece9d747f2
Add a testcase for switch instruction induction
...
llvm-svn: 11965
2004-02-28 21:30:39 +00:00
Chris Lattner
a854ddd528
Implement switch->br and br->switch folding by ripping out the switch->switch
...
and br->br code and generalizing it. This allows us to compile code like this:
int test(Instruction *I) {
if (isa<CastInst>(I))
return foo(7);
else if (isa<BranchInst>(I))
return foo(123);
else if (isa<UnwindInst>(I))
return foo(1241);
else if (isa<SetCondInst>(I))
return foo(1);
else if (isa<VAArgInst>(I))
return foo(42);
return foo(-1);
}
into:
int %_Z4testPN4llvm11InstructionE("struct.llvm::Instruction"* %I) {
entry:
%tmp.1.i.i.i.i.i.i.i = getelementptr "struct.llvm::Instruction"* %I, long 0, ubyte 4 ; <uint*> [#uses=1]
%tmp.2.i.i.i.i.i.i.i = load uint* %tmp.1.i.i.i.i.i.i.i ; <uint> [#uses=2]
%tmp.2.i.i.i.i.i.i = seteq uint %tmp.2.i.i.i.i.i.i.i, 27 ; <bool> [#uses=0]
switch uint %tmp.2.i.i.i.i.i.i.i, label %endif.0 [
uint 27, label %then.0
uint 2, label %then.1
uint 5, label %then.2
uint 14, label %then.3
uint 15, label %then.3
uint 16, label %then.3
uint 17, label %then.3
uint 18, label %then.3
uint 19, label %then.3
uint 32, label %then.4
]
...
As well as handling the cases in 176.gcc and many other programs more effectively.
llvm-svn: 11964
2004-02-28 21:28:10 +00:00
Chris Lattner
3583890ab7
Change this so that LLC actually tries to run the code generator, though it will
...
immediately abort due to lack of an instruction selector. :)
llvm-svn: 11963
2004-02-28 20:21:45 +00:00
Chris Lattner
ab9a9c4119
Add a hook to run with the V8 target, though it doesn't currently work. Also
...
mark the PPC backend as experimental
llvm-svn: 11962
2004-02-28 19:55:16 +00:00
Chris Lattner
38ae1362de
Add hook for V8 target
...
llvm-svn: 11961
2004-02-28 19:54:16 +00:00
Chris Lattner
529a354ea4
SparcV8 now builds.
...
llvm-svn: 11960
2004-02-28 19:54:00 +00:00
Chris Lattner
5effdb67b7
fine grainify namespacification
...
llvm-svn: 11959
2004-02-28 19:53:18 +00:00
Chris Lattner
3852b0c3b8
Finegrainify namespacification
...
llvm-svn: 11958
2004-02-28 19:52:49 +00:00
Chris Lattner
88268605ec
Tab completion is our friend.
...
llvm-svn: 11957
2004-02-28 19:45:39 +00:00
Chris Lattner
013aa47975
Clean up rules
...
llvm-svn: 11956
2004-02-28 19:43:40 +00:00
Chris Lattner
d2bb7e91b0
Bring this directory into "it actually compiles" land
...
llvm-svn: 11955
2004-02-28 19:37:18 +00:00
Chris Lattner
3f70429d28
Fix multiple inclusion problem
...
llvm-svn: 11954
2004-02-28 19:31:32 +00:00
Chris Lattner
69ab9e0840
if there is already a prototype for malloc/free, use it, even if it's incorrect.
...
Do not just inject a new prototype.
llvm-svn: 11951
2004-02-28 18:51:45 +00:00
Chris Lattner
9f35c413f5
Do not remove an active template argument even if the superclass had one of the
...
same name
llvm-svn: 11950
2004-02-28 17:41:48 +00:00
Chris Lattner
243e1df469
fix a bug in the testcase
...
llvm-svn: 11949
2004-02-28 17:33:21 +00:00
Chris Lattner
7d89f8837d
Ignore X = X assignments that was causing Alkis's rewrite of X86.td to crash
...
tblgen.
llvm-svn: 11948
2004-02-28 17:31:28 +00:00
Chris Lattner
fbca3a0161
new testcase for a tblgen bug that alkis ran into
...
llvm-svn: 11947
2004-02-28 16:43:44 +00:00