Commit Graph

138 Commits

Author SHA1 Message Date
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
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
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
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
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
Chris Lattner
fd05924946 Decrease usage of use_size()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 16:48:29 +00:00
Misha Brukman
cf00c4ab3b Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:57:28 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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