1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
Commit Graph

719 Commits

Author SHA1 Message Date
Alkis Evlogimenos
32a5b0fd6c Add OR and XOR memory operand support.
llvm-svn: 11549
2004-02-17 15:33:14 +00:00
Alkis Evlogimenos
1e4b3b3c9b Peephole optimize SUBmi{16,32} into SUBmi{16,32}b when immediate is 8
bits wide.

llvm-svn: 11548
2004-02-17 15:14:29 +00:00
Alkis Evlogimenos
4f22bb4d4b ADDmi{16,32} should be in the next case statement.
llvm-svn: 11547
2004-02-17 15:10:11 +00:00
Alkis Evlogimenos
135c4faa55 Add memory operand folding support for MUL, DIV, IDIV, NEG, NOT,
MOVSX, and MOVZX.

llvm-svn: 11546
2004-02-17 09:14:23 +00:00
Alkis Evlogimenos
e7bbd1c2fb Add memory operand folding for CMP{rm,mr,mi}{8,16,32}, INCm{8,16,32}
and DECm{8,16,32} instructions.

llvm-svn: 11545
2004-02-17 08:49:20 +00:00
Alkis Evlogimenos
d7e3cc8d65 Add CMP{rm,mr,mi}{8,16,32}, INCm{8,16,32} and DECm{8,16,32} instructions.
llvm-svn: 11544
2004-02-17 08:49:00 +00:00
Alkis Evlogimenos
638db7b5aa Add SUB{rm,mr,mi}{8,16,32} instructions.
llvm-svn: 11543
2004-02-17 08:17:40 +00:00
Alkis Evlogimenos
5aa39e1583 Add support for folding memory operands for ADC, SBB and SUB instructions.
llvm-svn: 11541
2004-02-17 08:08:51 +00:00
Alkis Evlogimenos
28691e063b Add support for ADC{rm.mr}32 and SBB{rm,mr}32.
llvm-svn: 11540
2004-02-17 08:06:31 +00:00
Chris Lattner
eb1428d581 Add a (hidden) option to print instructions that fail to fuse. It's looking
like compares and test's would be the next huge win...

llvm-svn: 11539
2004-02-17 08:03:47 +00:00
Alkis Evlogimenos
19248dd757 Add support for folding memory operands in MOVri{8,16,32} instructions.
llvm-svn: 11538
2004-02-17 07:47:20 +00:00
Chris Lattner
c4ea4d12bf Expand the repertoire of the forms we can print and encode.
llvm-svn: 11537
2004-02-17 07:40:44 +00:00
Chris Lattner
029dec8f3e Disable this peephole for now. We can't keep track of the fact that the immediate is 8 bits,
but the memory reference is full sized.

llvm-svn: 11536
2004-02-17 07:36:32 +00:00
Chris Lattner
a9493ad718 Add an option to disable spill fusing in the X86 backend
llvm-svn: 11531
2004-02-17 06:30:34 +00:00
Chris Lattner
d4b2f4ef32 Fix the mneumonics for the mov instructions to have the source and destination
order in the correct sense!! Arg!

llvm-svn: 11530
2004-02-17 06:28:19 +00:00
Chris Lattner
5757579731 Fix the last crimes against nature that used the 'ir' ordering to use the
'ri' ordering instead... no it's not possible to store a register into an
immediate!

llvm-svn: 11529
2004-02-17 06:24:02 +00:00
Chris Lattner
4682990fa5 GRRR. Move instructions have swapped the order of the r/m operands.
llvm-svn: 11528
2004-02-17 06:20:20 +00:00
Chris Lattner
16666f8bd2 Rename MOVi[mr] instructions to MOV[rm]i
llvm-svn: 11527
2004-02-17 06:16:44 +00:00
Chris Lattner
1db99b1949 Whoops, got my cases swapped.
llvm-svn: 11526
2004-02-17 06:02:15 +00:00
Chris Lattner
e227ae6b88 Change to match the newer, simpler, interface
llvm-svn: 11525
2004-02-17 05:54:57 +00:00
Chris Lattner
b82bb37952 Add support for folding memory operands into AND and IMUL's
llvm-svn: 11523
2004-02-17 05:46:06 +00:00
Chris Lattner
48e19d8b8e Scrunchify code, by adding helpers. No functionality changes.
llvm-svn: 11522
2004-02-17 05:35:13 +00:00
Chris Lattner
9751eb8ab9 Add mem forms of AND instructions
llvm-svn: 11521
2004-02-17 05:25:50 +00:00
Alkis Evlogimenos
c4ec9111bb Add API to check and fold memory operands into instructions.
llvm-svn: 11519
2004-02-17 04:33:18 +00:00
Chris Lattner
3c514e8a54 Rename the IMULri* instructions to IMULrri, as they are actually three address
instructions.  Add forms of these instructions that read from memory

llvm-svn: 11518
2004-02-17 04:26:43 +00:00
Alkis Evlogimenos
501e24b28a Add peephole optimizations for ADD [MEM], IMM8 instructions.
llvm-svn: 11511
2004-02-16 23:50:18 +00:00
Alkis Evlogimenos
657876c656 Add two more variants of add. Update comments.
llvm-svn: 11510
2004-02-16 23:48:42 +00:00
Chris Lattner
d8cc48da34 Add some ADD instructions that take memory operands for Alkis
llvm-svn: 11502
2004-02-16 18:19:31 +00:00
Alkis Evlogimenos
84318d7bb6 Make dense maps keyed on physical registers smallerusing
MRegisterInfo::getNumRegs() instead of
MRegisterInfo::FirstVirtualRegister.

Also use MRegisterInfo::is{Physical,Virtual}Register where
appropriate.

llvm-svn: 11477
2004-02-15 21:37:17 +00:00
Chris Lattner
af97b8450d Implement llvm.(frame|return)address(0) correctly. They are used by the LLVM JIT, among other
applications

llvm-svn: 11459
2004-02-15 01:04:03 +00:00
Alkis Evlogimenos
fc768e6db0 Fix problem in DEBUG code. I could be pointing past the end and
dereferencing it causes an assertion error.

llvm-svn: 11458
2004-02-15 00:46:41 +00:00
Chris Lattner
679c106ce3 Fix the 'have a framepointer' case, so that the frame pointer always points
to the old saved EBP.

llvm-svn: 11455
2004-02-15 00:15:37 +00:00
Alkis Evlogimenos
e8f9647831 Add back machine code deleter pass until we get a MachineCode pass
that will be responsible for the creation of MachineFunctions and will
be required by all MachineFunctionPass passes.

llvm-svn: 11453
2004-02-15 00:03:15 +00:00
Chris Lattner
cc5bf36481 Add support for the 'pop' instruction
llvm-svn: 11451
2004-02-14 21:06:02 +00:00
Chris Lattner
3246911460 There is no reason to align the stack pointer if there are no callees of this
function!

llvm-svn: 11450
2004-02-14 20:11:07 +00:00
Chris Lattner
f28479d600 The prologue/epilogue related method calls have no reason to return a value,
make them return void.

This allows us to avoid some costly MBB.size() calls

llvm-svn: 11448
2004-02-14 19:49:54 +00:00
Chris Lattner
1248c8a7f7 finegrainify namespacification, fix 80col prob
llvm-svn: 11445
2004-02-14 06:00:36 +00:00
Chris Lattner
c87772961e Urg, right. These need an input value...
llvm-svn: 11443
2004-02-14 04:47:23 +00:00
Chris Lattner
69b716e81c Codegen llvm.memset into rep stos[bwd]. Simplify code for llvm.memcpy
llvm-svn: 11442
2004-02-14 04:46:05 +00:00
Chris Lattner
6890963e48 add 'rep stos[bwd]' instructions
llvm-svn: 11441
2004-02-14 04:45:37 +00:00
Alkis Evlogimenos
a31a767307 Use newly added next() and prior() utility functions.
llvm-svn: 11430
2004-02-14 01:18:34 +00:00
Chris Lattner
bc565b2a6c There is no need to emit a shift if the size is constant, which is common
llvm-svn: 11420
2004-02-13 23:36:47 +00:00
Alkis Evlogimenos
6d6ab846af Remove getAllocatedRegNum(). Use getReg() instead.
llvm-svn: 11393
2004-02-13 21:01:20 +00:00
Chris Lattner
d1c4f4c833 Add support for the rep movs[bwd] instructions, and emit them when code
generating the llvm.memcpy intrinsic.

llvm-svn: 11351
2004-02-12 17:53:22 +00:00
Alkis Evlogimenos
94cab18bdc Change interface so that we can add to the end of a basic block
without getting an assertion from ilist that we are dereferencing
ilist<T>::end().

llvm-svn: 11345
2004-02-12 08:11:04 +00:00
Alkis Evlogimenos
b755d35fd2 Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.

llvm-svn: 11340
2004-02-12 02:27:10 +00:00
Chris Lattner
2a50f8218a s/getOpCode/getOpcode
llvm-svn: 11332
2004-02-11 19:26:28 +00:00
Chris Lattner
db2c8941a5 Add #include
llvm-svn: 11285
2004-02-10 21:18:55 +00:00
Chris Lattner
c9f1da7374 Remove uses of MachineOperand::isVirtualRegister
llvm-svn: 11281
2004-02-10 20:55:47 +00:00
Chris Lattner
d58b38eeca Don't use MachineOperator::is(Phys|Virt)Register
llvm-svn: 11276
2004-02-10 20:31:28 +00:00
Chris Lattner
421302bc54 Tighten up checks
llvm-svn: 11274
2004-02-10 20:25:13 +00:00
Chris Lattner
16690fad3d Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
8e4aa43710 Add a new (hidden) option that is useful for profiling.
llvm-svn: 11218
2004-02-09 01:47:10 +00:00
Alkis Evlogimenos
676e5b8997 Modify the two address instruction pass to remove the duplicate
operand of the instruction and thus simplify the register allocation.

llvm-svn: 11124
2004-02-04 22:17:40 +00:00
Brian Gaeke
dcab84ecf1 Take away the default iostream argument of createMachineFunctionPrinterPass(),
at Chris's request.

llvm-svn: 11120
2004-02-04 21:41:01 +00:00
Alkis Evlogimenos
a5458ae146 IMULri* instructions do not require their first two registers operands
to be the same (IOW they are not two address instructions).

llvm-svn: 11117
2004-02-04 17:21:04 +00:00
Chris Lattner
92211eb77d Generate ftst instructions for comparison against zero
llvm-svn: 11098
2004-02-03 18:54:04 +00:00
Chris Lattner
7b6e8f1f70 Add the ftst instruction
llvm-svn: 11095
2004-02-03 07:27:50 +00:00
Chris Lattner
8b623358ff Add support for one argument OneArgFP instructions
llvm-svn: 11094
2004-02-03 07:27:34 +00:00
Chris Lattner
06f08a26ac No need to declare implicit uses/defs of ST0
llvm-svn: 11081
2004-02-02 19:57:45 +00:00
Chris Lattner
71c12c8e0d Generate the fchs instruction to negate a floating point number
llvm-svn: 11078
2004-02-02 19:31:38 +00:00
Chris Lattner
36367e8c90 Add support for OneArgFPRW instructions, fix a couple of typeos
llvm-svn: 11077
2004-02-02 19:23:15 +00:00
Chris Lattner
963082346c Codegen -0.0 correctly. Do not use fldz! This is another -0.0 == +0.0 problem, arg.
llvm-svn: 11070
2004-02-02 18:56:30 +00:00
Alkis Evlogimenos
3c94357980 FpMOV is also a move instruction.
llvm-svn: 11055
2004-02-01 08:22:16 +00:00
Chris Lattner
f5b5d1f2f8 Add some comments sketching out how this is to work eventually.
llvm-svn: 11026
2004-01-30 22:25:18 +00:00
Chris Lattner
543fbaa973 Add a new flag, which is only used for symmetry.
llvm-svn: 11025
2004-01-30 22:24:18 +00:00
Chris Lattner
6f4945b965 Add (currently disabled) support to the instruction selector to only insert
FP_REG_KILL instructions at the end of blocks involved with critical edges.

Fix a bug where FP_REG_KILL instructions weren't inserted in fall through
unconditional branches.  Perhaps this will fix some linscan problems?

llvm-svn: 11019
2004-01-30 22:13:44 +00:00
Chris Lattner
a14e705677 Eliminate the isStringCompatible function, using ConstantArray::isString.
It's not clear why the code was looking for signed chars < 0, but it can't
matter to the assembler anyway, so the check goes away.

llvm-svn: 10853
2004-01-14 17:14:42 +00:00
Alkis Evlogimenos
44747c570a Output mov %REG = 0 instead of xor %REG, %REG, %REG to clear a
register so that LiveVariable analysis is not confused.

llvm-svn: 10773
2004-01-12 07:22:45 +00:00
Chris Lattner
c37577eb9f Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
implementation from the TargetMachine directly.

llvm-svn: 10636
2003-12-28 21:23:38 +00:00
Alkis Evlogimenos
24b3159dfc Add TargetInstrInfo::isMoveInstr() to support coalescing in register
allocation.

llvm-svn: 10633
2003-12-28 17:35:08 +00:00
Chris Lattner
c487970d6b Whoops, don't try to lower non intrinsic calls
llvm-svn: 10632
2003-12-28 09:53:23 +00:00
Chris Lattner
1791047661 implement support for the intrinsic lowering functionality
llvm-svn: 10629
2003-12-28 09:47:19 +00:00
Alkis Evlogimenos
0e892b6337 Move FP_REG_KILL closer to the return instruction.
llvm-svn: 10567
2003-12-21 16:47:43 +00:00
Alkis Evlogimenos
7b61337ce6 Move FP_REG_KILL closer to the actual branch instruction.
llvm-svn: 10563
2003-12-20 17:28:15 +00:00
Alkis Evlogimenos
41bd8284e3 Remove floating point killer pass. This is now implemented in the
instruction selector by adding a new pseudo-instruction
FP_REG_KILL. This instruction implicitly defines all x86 fp registers
and is a terminator so that passes which add machine code at the end
of basic blocks (like phi elimination) do not add instructions between
it and the branch or return instruction.

llvm-svn: 10562
2003-12-20 16:22:59 +00:00
Chris Lattner
ef1bfa35d0 Finally, _actually delete the machine code_ for a function, after it has
been emitted.  Also, since the FPK pass is causing memory access violations,
disable it.

llvm-svn: 10559
2003-12-20 10:20:19 +00:00
Chris Lattner
ea52ffdb10 Fix memory leak in the stackifier, due to the machinebasicblocks not holding
instructions on an ilist

llvm-svn: 10556
2003-12-20 10:12:17 +00:00
Chris Lattner
544d512d4f Finegrainify namespacification
Minor cleanups to killer pass

llvm-svn: 10555
2003-12-20 09:58:55 +00:00
Chris Lattner
d3676d0774 A minor cleanup for better encapsulation
llvm-svn: 10545
2003-12-20 02:03:14 +00:00
Chris Lattner
1cb1efedb3 Rip JIT specific stuff out of TargetMachine, as per PR176
llvm-svn: 10542
2003-12-20 01:22:19 +00:00
Alkis Evlogimenos
29127b8825 Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
    b) add isUse(), isDef()
    c) rename opHiBits32() to isHiBits32(),
              opLoBits32() to isLoBits32(),
              opHiBits64() to isHiBits64(),
              opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.

llvm-svn: 10461
2003-12-14 13:24:17 +00:00
Alkis Evlogimenos
b96436e679 Change preserve all claim to just preserve live variables and phielimination.
llvm-svn: 10460
2003-12-14 10:14:23 +00:00
Alkis Evlogimenos
5ca15c8f5e Add a floating point killer pass. This pass runs before register
allocaton on the X86 to add information to the machine code denoting
that our floating point stackifier cannot handle virtual point
register that are alive across basic blocks. This pass adds an
implicit def of all virtual floating point register at the end of each
basic block.

llvm-svn: 10446
2003-12-13 05:36:22 +00:00
John Criswell
93c209e4ac Modified cast so that it converts the int to a long before casting to
a pointer.  This evades a warning emitted by GCC when we cast from
unsigned int (32 bit) to void * (64 bit) on SparcV9.

llvm-svn: 10435
2003-12-12 19:57:48 +00:00
Chris Lattner
b750a0cf3a Implement the TargetMachine::getJITStubForFunction method for X86, finegrainify
namespacification.

llvm-svn: 10430
2003-12-12 07:11:18 +00:00
Chris Lattner
e9269b7cc5 Add an option to enable the SSA based peephole optimizer.
Eventually this pass will provide substantially better code in the interim between when we
have a crappy isel and nice isel.  Unfortunately doing so requires fixing the backend to
actually SUPPORT all of the fancy addressing modes that we now generate, and writing a DCE
pass for machine code.  Each of these is a fairly substantial job, so this will remain disabled
for the immediate future.  :(

llvm-svn: 10276
2003-12-01 05:18:30 +00:00
Chris Lattner
6f1c35bc68 Add a new SSA-based peephole optimizer which includes copy propagation and
folding of instructions into addressing modes.  This creates lots of dead
instructions, which are currently not deleted.  It also creates a lot of
instructions that the X86 backend currently cannot handle.  :(

llvm-svn: 10275
2003-12-01 05:15:28 +00:00
Chris Lattner
1a915e0a5f generalize the instruction types permitted a bit
llvm-svn: 10274
2003-12-01 05:13:56 +00:00
Chris Lattner
f0f44f414b Finegrainify namespacification
llvm-svn: 10270
2003-11-30 06:13:25 +00:00
Brian Gaeke
29723ca977 Support constant casting constant pointers to ints/uints, and/or
the other way around, instead of failing a large, tumor-like assertion.

llvm-svn: 10171
2003-11-22 07:18:25 +00:00
Brian Gaeke
296546cf0c Constant shift expressions, meet InstSelectSimple. Yow!!
llvm-svn: 10170
2003-11-22 06:49:41 +00:00
Brian Gaeke
8c4c9f6f1e Stub for constant shift expr support.
llvm-svn: 10168
2003-11-22 05:18:35 +00:00
Chris Lattner
6677af8dee Fix PR123
llvm-svn: 10069
2003-11-18 17:47:05 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
ca7a346fce Hopefully fix the objdir != srcdir issue
llvm-svn: 9761
2003-11-07 00:34:33 +00:00
Chris Lattner
e060df5b2c Fix warnings building on sparc
llvm-svn: 9758
2003-11-06 21:30:05 +00:00
Misha Brukman
c7c4e197fc We know exactly what the value of $< is, so instead of using basename $< to
get just the filename and not the full path, just use the filename directly.

llvm-svn: 9730
2003-11-05 06:43:36 +00:00
Alkis Evlogimenos
c6a7c83333 Change all machine basic block modifier functions in MRegisterInfo to
return the number of instructions added to/removed from the basic block
passed as their first argument.

Note: This is only needed because we use a std::vector instead of an
ilist to keep MachineBasicBlock instructions. Inserting an instruction
to a MachineBasicBlock invalidates all iterators to the basic
block. The return value can be used to update an index to the machine
basic block instruction vector and circumvent the iterator elimination
problem but this is really not needed if we move to a better
representation.

llvm-svn: 9704
2003-11-04 22:57:09 +00:00
Chris Lattner
c4cfc20335 Fix problems in previous changes. This fixes several regressions last night.
llvm-svn: 9694
2003-11-04 16:04:32 +00:00
Chris Lattner
414e572f11 Significantly simplify constant emission by unifying the stuff which used to build up
strings with the stuff that used to print to an ostream directly.  We now NEVER build
up big strings, only to print them once they are formed.

llvm-svn: 9686
2003-11-03 20:19:49 +00:00
Chris Lattner
f100e90240 Incorporate printSingleConstantValue into its single caller
llvm-svn: 9684
2003-11-03 19:44:05 +00:00
Chris Lattner
2943114bfd * Reformat some code
* Emit bools as 1/0 instead of true/false, fixing compilation of eon and
  PR 83 & Jello/2003-11-03-GlobalBool.llx

llvm-svn: 9683
2003-11-03 19:33:45 +00:00
Chris Lattner
0e32494c79 Delete unused EmitByteSwap method
Implement mul/div/rem constant expressions

llvm-svn: 9424
2003-10-23 17:21:43 +00:00
Misha Brukman
0f649c0045 * Order includes according to style guide
* Convert tabs to spaces
* Make code fit within 80 columns

llvm-svn: 9416
2003-10-23 16:22:08 +00:00
Misha Brukman
f8d45938f8 Converted tabs to spaces.
llvm-svn: 9360
2003-10-22 03:10:26 +00:00
John Criswell
de34542f41 Added LLVM copyright header.
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell
71d2894956 Added LLVM copyright notice to Makefiles.
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Brian Gaeke
9501118e3b Minor leftover fixups from replaceMachineCodeForFunction () change.
llvm-svn: 9295
2003-10-20 17:59:09 +00:00
Brian Gaeke
afbe8787cc Make replaceMachineCodeForFunction return void.
llvm-svn: 9288
2003-10-20 15:15:17 +00:00
Chris Lattner
c4f8226aaf Emit x86 instructions for: A = B op C, where A and B are 16-bit registers,
C is a constant which can be sign-extended from 8 bits without value loss,
and op is one of: add, sub, imul, and, or, xor.

This allows the JIT to emit the one byte version of the constant instead of
the two or 4 byte version.  Because these instructions are very common, this
can save a LOT of code space.  For example, I sampled two benchmarks, 176.gcc
and 254.gap.

BM        Old     New    Reduction
176.gcc 2673621 2548962  4.89%
254.gap  498261  475104  4.87%

Note that while the percentage is not spectacular, this did eliminate
124.6 _KILOBYTES_ of codespace from gcc.  Not bad.

Note that this doesn't effect the llc version at all, because the assembler
already does this optimization.

llvm-svn: 9284
2003-10-20 05:53:31 +00:00
Chris Lattner
c83d8249cb Further cleanups and simplifications
llvm-svn: 9282
2003-10-20 04:48:06 +00:00
Chris Lattner
fce0650cee Eliminate code for pointer size and endianness emulation.
llvm-svn: 9281
2003-10-20 04:11:23 +00:00
Misha Brukman
be506fc1c5 The Grammar Police was here.
llvm-svn: 9280
2003-10-20 04:03:10 +00:00
Chris Lattner
5a577c0b28 * Rename X86::IMULr16 -> X86::IMULrr16
* Implement R1 = R2 * C where R1 and R2 are 32 or 16 bits. This avoids an
  extra copy into a register, reducing register pressure.

llvm-svn: 9278
2003-10-20 03:42:58 +00:00
Chris Lattner
3d519c7bab * Multiplications by 2^X are turned into shifts. This factors code out of the
getelementptr code path for use by other code paths (like malloc and alloca).
* Optimize comparisons with zero
* Generate neg, not, inc, and dec instructions, when possible.

This gives some code size wins, which might translate into performance.  We'll
see tommorow in the nightly tester.

llvm-svn: 9267
2003-10-19 21:09:10 +00:00
Chris Lattner
57825f087d Add some new instructions. Wheee
llvm-svn: 9266
2003-10-19 19:25:35 +00:00
Chris Lattner
9107ee3a11 .string adds an implicit zero at the end. This is not what we wanted.
This fixes PR#44.

llvm-svn: 9252
2003-10-19 02:51:01 +00:00
Chris Lattner
de87c8a892 Fix bug: Jello/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.llx
This also fixes miscompilation of 176.gcc.

llvm-svn: 9249
2003-10-19 00:26:11 +00:00
Chris Lattner
0a276257ae Add support for the new varargs intrinsics
llvm-svn: 9224
2003-10-18 05:56:40 +00:00
Brian Gaeke
821c0e653c You can't just blat the address into memory, you have to blat its
displacement.

llvm-svn: 9210
2003-10-17 21:47:25 +00:00
Brian Gaeke
21797d71d9 Implement replaceMachineCodeForFunction() for x86.
llvm-svn: 9204
2003-10-17 18:27:46 +00:00
Brian Gaeke
4380148f33 Add prototype for replaceMachineCodeForFunction().
llvm-svn: 9202
2003-10-17 18:27:25 +00:00
Brian Gaeke
edea9eca83 Fix typo in comment.
llvm-svn: 9187
2003-10-16 23:45:05 +00:00
Chris Lattner
f46c45682a Add support for 'weak' linkage.
llvm-svn: 9171
2003-10-16 18:29:00 +00:00
Chris Lattner
f2ed60c0b7 Decrease usage of use_size()
llvm-svn: 9135
2003-10-15 16:48:29 +00:00
Chris Lattner
c115e75755 Output a contorted sequence of instructions to make sure that we don't access
off the bottom of the stack.  This fixes PR#41

llvm-svn: 9114
2003-10-14 19:09:05 +00:00
Chris Lattner
907de53acb Disable the leaf function optimization, which is apparently not legal on
X86/linux.  :(  The problem is that a signal delivered while the function
is executing could clobber the functions stack.  This is a partial fix
for PR41.

llvm-svn: 9113
2003-10-14 18:52:41 +00:00
Misha Brukman
868eac95dd Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Brian Gaeke
f9a4341b54 Add # of printed instructions statistic to both the SPARC and X86 LLC backends.
llvm-svn: 8892
2003-10-06 15:41:21 +00:00
Chris Lattner
fc3f9605a7 Instead of hacking in custom support for Invoke/Unwind, use the LowerInvoke pass
llvm-svn: 8871
2003-10-05 19:15:47 +00:00
Alkis Evlogimenos
a37b58ce09 Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.
llvm-svn: 8819
2003-10-02 16:57:49 +00:00
Alkis Evlogimenos
42a09316bb Change llc command line for register allocators
llvm-svn: 8815
2003-10-02 06:13:19 +00:00
Alkis Evlogimenos
a50598c684 Revert previous change. For some reason this went into the main branch
llvm-svn: 8805
2003-10-01 19:40:13 +00:00
Alkis Evlogimenos
e3af981096 Added command line option for linear scan allocator
llvm-svn: 8804
2003-10-01 19:38:10 +00:00
Chris Lattner
5468c196f3 Be a little more specific about what is begin generated. Only print
command line if VERBOSE=1

llvm-svn: 8453
2003-09-10 19:52:54 +00:00
Chris Lattner
f9db4af8bf Only emit inter-field-padding if the amount of padding is != 0
llvm-svn: 8452
2003-09-10 19:52:24 +00:00
John Criswell
e783801878 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.

llvm-svn: 8424
2003-09-09 20:57:03 +00:00
Chris Lattner
e35b8fabc4 * 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!

llvm-svn: 8417
2003-09-09 16:23:36 +00:00
Chris Lattner
e8ae7bf114 Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
llvm-svn: 8411
2003-09-08 19:44:26 +00:00
Chris Lattner
4ad8720f91 Add support for the unwind instruction
llvm-svn: 8408
2003-09-08 18:54:55 +00:00
John Criswell
bd1d21a0b4 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.

llvm-svn: 8379
2003-09-06 14:50:22 +00:00
Chris Lattner
3d53c382ba OptInfo is no longer required
llvm-svn: 8312
2003-09-01 20:41:07 +00:00
Chris Lattner
062cc9d341 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.

llvm-svn: 8187
2003-08-28 21:23:43 +00:00
Chris Lattner
f31d84d7c5 Targets should configure themselves based on a Module, not some wierd flags
llvm-svn: 8132
2003-08-24 19:49:48 +00:00
Chris Lattner
d627d84e23 Implement: Jello/test-constantexpr.ll
llvm-svn: 8127
2003-08-24 19:19:47 +00:00
Chris Lattner
ce3c869e38 Change all #include'd files to be :: rules instead of : rules
llvm-svn: 8019
2003-08-21 20:37:17 +00:00
Chris Lattner
f54b131a49 Add support for the sig(set|long)jmp intrinsics
llvm-svn: 7951
2003-08-18 16:06:09 +00:00
Misha Brukman
56f7db4178 Spell `necessary' correctly.
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Chris Lattner
c5e9b1f3cd 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.

llvm-svn: 7928
2003-08-17 23:20:40 +00:00
Chris Lattner
fb986e7b44 Adjust to new API, add expandCall stub
llvm-svn: 7873
2003-08-15 04:51:59 +00:00
Chris Lattner
8d79ae7383 Add support for unconditional branches and for emitting JE instructions
llvm-svn: 7872
2003-08-15 04:50:49 +00:00
Brian Gaeke
4fff8d3bd8 X86 static backend: smacked
Function at a time: smacked

Who you gonna call!!!  :-)

llvm-svn: 7826
2003-08-13 19:02:09 +00:00
Brian Gaeke
77c65be59e Factory methods for FunctionPasses now return type FunctionPass *.
llvm-svn: 7823
2003-08-13 18:18:15 +00:00
Brian Gaeke
299cf12f45 addPassesToJITCompile and addPassesToEmitMachineCode now take a
FunctionPassManager, to support function-at-a-time compilation and
 emission of code.

llvm-svn: 7821
2003-08-13 18:17:27 +00:00
Brian Gaeke
ccafb6e504 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.

llvm-svn: 7817
2003-08-13 18:15:52 +00:00
Brian Gaeke
feb6f95e87 Factory methods for FunctionPasses now return type FunctionPass *.
Correct one of the functions' comments.

llvm-svn: 7816
2003-08-13 18:15:29 +00:00
Brian Gaeke
a735c79a1b 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.

llvm-svn: 7815
2003-08-13 18:15:15 +00:00
Brian Gaeke
595d18ac2a Just incorporating some notes I wrote for myself into a place where they won't
get lost...

llvm-svn: 7798
2003-08-13 00:30:48 +00:00
Chris Lattner
be0530bab9 Add basic support for 16 and 32 bit function arguments!
llvm-svn: 7755
2003-08-11 21:30:00 +00:00
Chris Lattner
a577beaba5 Sort #includes, eliminate #include of "llvm/Type.h" which was redundant
llvm-svn: 7746
2003-08-11 20:06:16 +00:00
Chris Lattner
05b3cd4716 Cygwin apparently works with %'s on registers!
llvm-svn: 7745
2003-08-11 20:04:57 +00:00
Chris Lattner
d29a705b4b Whoops, accidental checkin. :(
llvm-svn: 7743
2003-08-11 19:35:46 +00:00
Chris Lattner
84e5185cbd 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.

llvm-svn: 7742
2003-08-11 19:35:26 +00:00
Brian Gaeke
e599cf3856 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.

llvm-svn: 7737
2003-08-11 19:05:46 +00:00
Chris Lattner
1ecd1818a0 Add (ret int) expander so that we can at least write testcases
llvm-svn: 7730
2003-08-11 15:48:00 +00:00
Misha Brukman
caed7aad11 Converted tabs to spaces.
llvm-svn: 7728
2003-08-11 15:38:50 +00:00
Misha Brukman
a0b2a82f8d Removed `-debug' so that spurious printouts of patterns are not seen at
compilation time.

llvm-svn: 7727
2003-08-11 15:30:20 +00:00
Chris Lattner
3f4b5cf09a Add patterns for multiply, and, or, and xor
llvm-svn: 7725
2003-08-11 15:23:25 +00:00
Chris Lattner
4650950aee Until the pattern matching instruction selector is finished, enable debug output from it
llvm-svn: 7722
2003-08-11 15:11:01 +00:00
Chris Lattner
3dc2860679 Add support for a pattern matching instruction selector. This is still in
the early implementation phases, so it is disabled by default

llvm-svn: 7719
2003-08-11 14:59:22 +00:00
Chris Lattner
a263312e82 This register is never used, disable it.
llvm-svn: 7661
2003-08-07 04:49:16 +00:00
Chris Lattner
07a484e6f6 Completely eliminate the isVoid TSFlag, shifting over all other fields
llvm-svn: 7636
2003-08-06 15:32:20 +00:00
Chris Lattner
83831c66fc add a pattern for RET, immediates no longer need to be explicitly typed
llvm-svn: 7635
2003-08-06 15:31:35 +00:00
Chris Lattner
6488844c2e Factor shared code
llvm-svn: 7600
2003-08-05 16:34:44 +00:00
Chris Lattner
17fc21b5fa This is the real fix for the previous register allocator problem.
Physical registers should not float around.

llvm-svn: 7587
2003-08-05 00:48:47 +00:00
Chris Lattner
cf51f31c3e 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.

llvm-svn: 7581
2003-08-04 21:18:19 +00:00
Chris Lattner
900d31f5ba Change comments into something that TableGen can read!
llvm-svn: 7580
2003-08-04 21:08:29 +00:00
Chris Lattner
cd1aec5a9d Rename register classes to be upper case to make it obvious that they are X86
specific in the tree patterns

llvm-svn: 7578
2003-08-04 20:58:29 +00:00
Chris Lattner
f62d020c88 There is nothing special about noops anymore
llvm-svn: 7568
2003-08-04 05:11:37 +00:00
Chris Lattner
0d7b042206 transition to using let instead of set
llvm-svn: 7564
2003-08-04 04:59:56 +00:00
Chris Lattner
15891a50c1 Fix Bug: test/Regression/Jello/2003-08-03-CallArgLiveRanges.llx
llvm-svn: 7558
2003-08-04 02:12:48 +00:00
Chris Lattner
b79989c60d Simplify some constant expressions
llvm-svn: 7556
2003-08-04 01:04:59 +00:00
Chris Lattner
52f4e7d96d Remove illegal, unsupported escapes. This fixes program: Ptrdist-bc
llvm-svn: 7552
2003-08-03 23:42:17 +00:00
Chris Lattner
96704b97ca * 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.

llvm-svn: 7551
2003-08-03 23:37:09 +00:00
Chris Lattner
e9a18e0f9f Specify custom name for registers to get the ()'s in the name.
llvm-svn: 7547
2003-08-03 22:12:47 +00:00
Chris Lattner
8cca0ab42b Start using tablegen'd instruction enum list
llvm-svn: 7542
2003-08-03 21:57:05 +00:00
Chris Lattner
21c04e759f Resort tables
llvm-svn: 7541
2003-08-03 21:56:36 +00:00
Chris Lattner
1bc88585c3 Lump the base opcode in with the X86 TargetSpecific flags
llvm-svn: 7540
2003-08-03 21:56:22 +00:00
Chris Lattner
128b75130d * 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...

llvm-svn: 7539
2003-08-03 21:55:55 +00:00
Chris Lattner
4e20fd5a9b Start using tablegenerated instruction descriptions
llvm-svn: 7538
2003-08-03 21:54:59 +00:00
Chris Lattner
89b4a26e56 Add new TableGen instruction definitions
llvm-svn: 7537
2003-08-03 21:54:21 +00:00
Chris Lattner
9249afaa83 Remove the old .def file, it is now obsolete
llvm-svn: 7536
2003-08-03 21:54:06 +00:00
Chris Lattner
25e28f61ab Set debug types
llvm-svn: 7532
2003-08-03 21:14:38 +00:00
Chris Lattner
7ef512fec1 Add Target class for X86 target
llvm-svn: 7523
2003-08-03 18:19:37 +00:00
Chris Lattner
6b3f365906 The RegisterInfo class is obsolete
llvm-svn: 7522
2003-08-03 18:18:48 +00:00
Chris Lattner
964738dd71 Tell CVS to ignore all .inc files
llvm-svn: 7513
2003-08-03 15:50:17 +00:00
Chris Lattner
5969ff707d Switch over to tablegen generated header files
llvm-svn: 7512
2003-08-03 15:48:55 +00:00
Chris Lattner
457b33f7e4 Switch over to TableGen generated register file description
llvm-svn: 7511
2003-08-03 15:48:14 +00:00
Chris Lattner
0891dd9161 Initial checkin of X86.td file
llvm-svn: 7510
2003-08-03 15:47:49 +00:00
Chris Lattner
f4bfcad4ea Initial checkin of X86 Register File description
llvm-svn: 7509
2003-08-03 15:47:25 +00:00
Chris Lattner
8aa04e1e4c Fix typeos in comments
llvm-svn: 7505
2003-08-03 13:50:14 +00:00
Chris Lattner
1baa706ab7 Move DEBUG to Debug.h
llvm-svn: 7497
2003-08-01 22:21:34 +00:00
Chris Lattner
8dce81478f This method is long dead
llvm-svn: 7460
2003-08-01 03:48:42 +00:00
Chris Lattner
79a56ff370 Remove more obsolete comments
llvm-svn: 7455
2003-07-31 17:56:05 +00:00
Misha Brukman
f451b1f332 Changed pointer to the JIT code to its current location, under LLI.
llvm-svn: 7454
2003-07-31 17:50:35 +00:00
Brian Gaeke
4449b3c963 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.

llvm-svn: 7452
2003-07-31 17:38:52 +00:00
Chris Lattner
cf28d0f799 Use target specific interface instead of forcing it to be target-generic
llvm-svn: 7413
2003-07-30 05:33:48 +00:00
Chris Lattner
8fdf81b97e Move "register flags" definition the type of registers to be fully fledged
value types

llvm-svn: 7377
2003-07-29 05:14:16 +00:00
Chris Lattner
40cc4c1392 Rename function to be more consistent with filename
llvm-svn: 7352
2003-07-26 23:49:58 +00:00
Chris Lattner
f0df04752d We don't modify the LLVM rep, remain const correct
llvm-svn: 7345
2003-07-26 23:06:00 +00:00
Chris Lattner
b92653f037 If the pass changes _anything_ it must return true
llvm-svn: 7344
2003-07-26 23:05:37 +00:00
Brian Gaeke
dc07ea6681 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.)

llvm-svn: 7299
2003-07-24 20:20:44 +00:00
Brian Gaeke
77b077a109 It doesn't appear that we need to #include these.
llvm-svn: 7291
2003-07-24 17:48:53 +00:00
Brian Gaeke
4afe7aea5f 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.

llvm-svn: 7288
2003-07-24 17:30:45 +00:00
Brian Gaeke
5674309dc1 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().

llvm-svn: 7275
2003-07-23 20:25:08 +00:00
Brian Gaeke
9de468d398 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.

llvm-svn: 7265
2003-07-23 18:37:06 +00:00
Chris Lattner
6ad460b336 Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting

llvm-svn: 7252
2003-07-23 15:22:26 +00:00
Brian Gaeke
bf46d75365 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.

llvm-svn: 7205
2003-07-18 20:23:43 +00:00
Brian Gaeke
638e6ef31c Use getClassB for load and store; we don't want to abort when we
try to load or store through a bool*.

llvm-svn: 7195
2003-07-17 21:30:06 +00:00
Brian Gaeke
89ce6ca0a6 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.)

llvm-svn: 7168
2003-07-11 21:57:01 +00:00
Brian Gaeke
efd836df31 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.

llvm-svn: 7165
2003-07-11 18:18:35 +00:00
Brian Gaeke
028985aa27 Insert workaround for GAS bug in assembling FLD/FSTP XWORD PTR [...]
instructions, by outputting them as bytes.

llvm-svn: 7115
2003-07-07 18:34:20 +00:00
John Criswell
258dfc0319 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner
d212141d9e Setjmp should always return zero if we don't implement longjmp. This avoids
leaving trash in the register, fixing anagram

llvm-svn: 7013
2003-06-30 19:35:54 +00:00
Chris Lattner
6b31a873ee Until there is a setjmp/longjmp transformation pass, codegen setjmp as a noop
and longjmp as an abort!

llvm-svn: 6977
2003-06-29 16:42:32 +00:00
Brian Gaeke
6f2c46cd52 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.

llvm-svn: 6924
2003-06-27 00:00:48 +00:00
Brian Gaeke
7f1a3ef833 Number constants from constant pool as CPIf_i where f is the function index
and i is the constant pool index.

llvm-svn: 6920
2003-06-26 18:02:30 +00:00
Brian Gaeke
ff614a8a0c Integrate the C writer's name mangler.
llvm-svn: 6908
2003-06-25 22:00:39 +00:00
Brian Gaeke
065bf4bab2 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.

llvm-svn: 6907
2003-06-25 18:01:07 +00:00
Chris Lattner
38b7729915 Do not use the inefficient, fixed function, CBW, CDQ, ... instructions
llvm-svn: 6844
2003-06-22 03:31:18 +00:00
Chris Lattner
7fb273d416 Minor simplification to 64-bit instsel
llvm-svn: 6831
2003-06-21 18:15:27 +00:00
Chris Lattner
2840a1b4ee 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!

llvm-svn: 6830
2003-06-21 17:16:58 +00:00
Chris Lattner
2b10fcccd0 Add IMULr16 & IMULr32 instructions
llvm-svn: 6829
2003-06-21 17:13:35 +00:00
Chris Lattner
4a8d96567f Generate code for LONG indexes to getelementptr instructions more efficiently
llvm-svn: 6828
2003-06-21 16:01:24 +00:00
Brian Gaeke
a45dda3054 Fix output bug: Intel asm comment character is #, not ;.
llvm-svn: 6792
2003-06-19 19:58:32 +00:00
Brian Gaeke
9a1a7c9671 RECAPITALIZE all the names of pseudo-instructions, and add a comment explaining
the convention.

:-)

llvm-svn: 6791
2003-06-19 19:41:13 +00:00
Brian Gaeke
a734842f8a 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.

llvm-svn: 6790
2003-06-19 19:34:44 +00:00
Brian Gaeke
beb320af87 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.

llvm-svn: 6789
2003-06-19 19:32:32 +00:00
Brian Gaeke
7d145b44cc lib/Target/X86/X86TargetMachine.{cpp,h}: Add initial version
(non-working) of llc guts for X86, and add a prototype for it.

llvm-svn: 6779
2003-06-18 21:43:21 +00:00
Brian Gaeke
4681b27a92 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.

llvm-svn: 6723
2003-06-16 21:54:01 +00:00
Chris Lattner
d4e4130f0a Fix warnings on Sparc
llvm-svn: 6658
2003-06-06 18:25:33 +00:00
Chris Lattner
437985e52c Add statistic for # machine instrs emitted
Add GROSS HACK to get CompilationCallback to work when compiled in release mode

llvm-svn: 6646
2003-06-06 04:00:05 +00:00
Chris Lattner
6a3d2fc70e Implement generation of cmp R, C to not use an extra register
llvm-svn: 6627
2003-06-05 19:30:30 +00:00
Chris Lattner
ee044c3179 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. :)

llvm-svn: 6626
2003-06-05 18:28:55 +00:00
Chris Lattner
c1bc144c7d Add instructions for (add|sub|and|or|xor)ri(8|16|32)
llvm-svn: 6625
2003-06-05 18:25:08 +00:00
Chris Lattner
1cb899dd19 Remove usage of typedef
llvm-svn: 6583
2003-06-03 15:41:58 +00:00
Chris Lattner
92fba99afb Add namespace comments for doxygen
llvm-svn: 6581
2003-06-03 15:31:23 +00:00
Misha Brukman
cb7c80a95c Eliminated a compiler warning due to casting to a different-sized datatype.
llvm-svn: 6531
2003-06-02 04:13:58 +00:00