Commit Graph

447 Commits

Author SHA1 Message Date
Chris Lattner
4482715f3d implement support for the intrinsic lowering functionality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10629 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 09:47:19 +00:00
Alkis Evlogimenos
0ef76cadbb Move FP_REG_KILL closer to the return instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10567 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-21 16:47:43 +00:00
Alkis Evlogimenos
9abc81790e Move FP_REG_KILL closer to the actual branch instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10563 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 17:28:15 +00:00
Alkis Evlogimenos
e0bb3e766d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10562 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 16:22:59 +00:00
Chris Lattner
655239cc6b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10559 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 10:20:19 +00:00
Chris Lattner
9068574a29 Fix memory leak in the stackifier, due to the machinebasicblocks not holding
instructions on an ilist


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10556 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 10:12:17 +00:00
Chris Lattner
f2e49d4c1a Finegrainify namespacification
Minor cleanups to killer pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10555 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 09:58:55 +00:00
Chris Lattner
2828970819 A minor cleanup for better encapsulation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10545 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 02:03:14 +00:00
Chris Lattner
1e60a9165d Rip JIT specific stuff out of TargetMachine, as per PR176
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10542 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 01:22:19 +00:00
Alkis Evlogimenos
4d7af65903 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10461 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 13:24:17 +00:00
Alkis Evlogimenos
97323a47d8 Change preserve all claim to just preserve live variables and phielimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10460 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 10:14:23 +00:00
Alkis Evlogimenos
359b65f782 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10446 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-13 05:36:22 +00:00
John Criswell
52b62de100 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10435 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 19:57:48 +00:00
Chris Lattner
65b05ce022 Implement the TargetMachine::getJITStubForFunction method for X86, finegrainify
namespacification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10430 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 07:11:18 +00:00
Chris Lattner
9b527704f7 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.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10276 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-01 05:18:30 +00:00
Chris Lattner
4537076ee8 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.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10275 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-01 05:15:28 +00:00
Chris Lattner
f2d2925452 generalize the instruction types permitted a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10274 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-01 05:13:56 +00:00
Chris Lattner
e1cc79f1cf Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10270 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 06:13:25 +00:00
Brian Gaeke
f9c86cf5cf Support constant casting constant pointers to ints/uints, and/or
the other way around, instead of failing a large, tumor-like assertion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10171 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 07:18:25 +00:00
Brian Gaeke
dfcc9cfaa8 Constant shift expressions, meet InstSelectSimple. Yow!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10170 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 06:49:41 +00:00
Brian Gaeke
2dd3e1b435 Stub for constant shift expr support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10168 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 05:18:35 +00:00
Chris Lattner
62b767b8d7 Fix PR123
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10069 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-18 17:47:05 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Chris Lattner
0239d7af57 Hopefully fix the objdir != srcdir issue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9761 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 00:34:33 +00:00
Chris Lattner
2bee057a56 Fix warnings building on sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9758 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-06 21:30:05 +00:00
Misha Brukman
7f1affe677 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9730 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 06:43:36 +00:00
Alkis Evlogimenos
e668dab5b3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9704 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-04 22:57:09 +00:00
Chris Lattner
9053356dd1 Fix problems in previous changes. This fixes several regressions last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9694 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-04 16:04:32 +00:00
Chris Lattner
ac662d1e02 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9686 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-03 20:19:49 +00:00
Chris Lattner
3e119c68fe Incorporate printSingleConstantValue into its single caller
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9684 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-03 19:44:05 +00:00
Chris Lattner
603c56213d * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9683 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-03 19:33:45 +00:00
Chris Lattner
cadff4477e Delete unused EmitByteSwap method
Implement mul/div/rem constant expressions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9424 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 17:21:43 +00:00
Misha Brukman
c8893fcc71 * Order includes according to style guide
* Convert tabs to spaces
* Make code fit within 80 columns


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9416 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 16:22:08 +00:00
Misha Brukman
2e385b4622 Converted tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9360 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 03:10:26 +00:00
John Criswell
856ba76200 Added LLVM copyright header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:17:13 +00:00
John Criswell
e488e9360b Added LLVM copyright notice to Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 22:26:57 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Brian Gaeke
0522b0846c Minor leftover fixups from replaceMachineCodeForFunction () change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9295 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 17:59:09 +00:00
Brian Gaeke
682ce72e60 Make replaceMachineCodeForFunction return void.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 15:15:17 +00:00
Chris Lattner
43a5ff8d40 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9284 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 05:53:31 +00:00
Chris Lattner
6ac1d71588 Further cleanups and simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9282 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 04:48:06 +00:00
Chris Lattner
6c09db2959 Eliminate code for pointer size and endianness emulation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9281 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 04:11:23 +00:00
Misha Brukman
44ffd5adac The Grammar Police was here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9280 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 04:03:10 +00:00
Chris Lattner
c01d1232fe * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9278 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 03:42:58 +00:00
Chris Lattner
b2acc51bb2 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9267 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:09:10 +00:00
Chris Lattner
f634a103ee Add some new instructions. Wheee
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9266 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 19:25:35 +00:00
Chris Lattner
b169841166 .string adds an implicit zero at the end. This is not what we wanted.
This fixes PR#44.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 02:51:01 +00:00
Chris Lattner
a81fc68f8e Fix bug: Jello/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.llx
This also fixes miscompilation of 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9249 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 00:26:11 +00:00
Chris Lattner
7381506368 Add support for the new varargs intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9224 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:56:40 +00:00
Brian Gaeke
e5f6859911 You can't just blat the address into memory, you have to blat its
displacement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9210 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 21:47:25 +00:00