Commit Graph

120 Commits

Author SHA1 Message Date
Chris Lattner 7c257321c7 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 796684b8c7 Fix Bug: test/Regression/Jello/2003-08-03-CallArgLiveRanges.llx
llvm-svn: 7558
2003-08-04 02:12:48 +00:00
Chris Lattner ea6aac412d 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 a2e2f5cc45 Rename function to be more consistent with filename
llvm-svn: 7352
2003-07-26 23:49:58 +00:00
Chris Lattner ba21b33499 If the pass changes _anything_ it must return true
llvm-svn: 7344
2003-07-26 23:05:37 +00:00
Chris Lattner 6077c3195f 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 26bb3c1df6 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 ac7c5a5241 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
Chris Lattner 53426e6526 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 7ac937e011 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
Chris Lattner 53b843fc04 Do not use the inefficient, fixed function, CBW, CDQ, ... instructions
llvm-svn: 6844
2003-06-22 03:31:18 +00:00
Chris Lattner 6e1ec2394f Minor simplification to 64-bit instsel
llvm-svn: 6831
2003-06-21 18:15:27 +00:00
Chris Lattner 22f54501be 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 df1230ecf2 Generate code for LONG indexes to getelementptr instructions more efficiently
llvm-svn: 6828
2003-06-21 16:01:24 +00:00
Chris Lattner f6db070e65 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 06250116a8 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 fd2a8f5868 Remove usage of typedef
llvm-svn: 6583
2003-06-03 15:41:58 +00:00
Chris Lattner 4536fcd57b * Implement cast (long|ulong) to bool
* Fix cast of (short|ushort|int|uint) to bool to work right

llvm-svn: 6510
2003-06-01 03:38:24 +00:00
Chris Lattner 372086c87b Add support for shl and shr for 64 bit integer types
llvm-svn: 6499
2003-06-01 01:56:54 +00:00
Chris Lattner 9c105cd27f Clean up #includes
llvm-svn: 6173
2003-05-13 20:21:19 +00:00
Chris Lattner 3fa7b77ddf Make abort more explicit
llvm-svn: 6151
2003-05-12 21:16:26 +00:00
Chris Lattner d4e5409f35 Remove the assertion failure of course... doh
llvm-svn: 6150
2003-05-12 20:39:39 +00:00
Chris Lattner 5069283493 Implement casts from unsigned integers to floating point
llvm-svn: 6148
2003-05-12 20:36:13 +00:00
Chris Lattner 6c906adb73 Make error messages more useful than jsut an abort
llvm-svn: 6146
2003-05-12 20:16:58 +00:00
Chris Lattner 786bd8849a Do not insert multiple initializations for the same value in a PHI node
llvm-svn: 6113
2003-05-12 14:22:21 +00:00
Chris Lattner 93c8eddd75 Add support for Add, Sub, And, Or, & Xor constant exprs
llvm-svn: 6049
2003-05-08 20:49:25 +00:00
Chris Lattner b257aab658 Add support for variable argument functions!
llvm-svn: 6046
2003-05-08 19:44:13 +00:00
Chris Lattner d964c3b9fd IMPLICIT_DEF was not the beautiful elegant solution I thought it was going
to be.  In fact, it made stuff worse.  :(

llvm-svn: 6013
2003-05-07 19:21:28 +00:00
Chris Lattner 37ffac92d5 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

llvm-svn: 6010
2003-05-06 21:32:22 +00:00
Misha Brukman effa5ba1ac The Hyphenation-Adding Committee is now in session.
llvm-svn: 5986
2003-05-03 02:18:17 +00:00
Chris Lattner 2a2338f1ba Fix bogus assert
llvm-svn: 5949
2003-04-25 21:58:54 +00:00
Chris Lattner ec6f16eae6 Fix iterator invalidation problem with cast instructions
llvm-svn: 5876
2003-04-23 17:57:48 +00:00
Chris Lattner 2670371c9a Implement the constantexpr CAST instruction correctly
llvm-svn: 5875
2003-04-23 17:22:12 +00:00
Misha Brukman e569e992d8 It's "necessary" to spell "necessarily" correctly.
llvm-svn: 5833
2003-04-22 17:54:23 +00:00
Chris Lattner 5b348718df Add support for a simple constantexpr: cast of one ptr type to another
llvm-svn: 5829
2003-04-21 21:33:44 +00:00
Chris Lattner 76e9f774dd Don't emit unneccesary branch instructions!
llvm-svn: 5328
2003-01-16 18:07:23 +00:00
Chris Lattner 2f983fcce3 Implement optimization folding setcc into branch.
llvm-svn: 5324
2003-01-16 16:43:00 +00:00
Chris Lattner b2809dc6b5 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.

llvm-svn: 5320
2003-01-16 02:20:12 +00:00
Chris Lattner b4d58d7f9e Rename MachineInstrInfo -> TargetInstrInfo
llvm-svn: 5272
2003-01-14 22:00:31 +00:00
Chris Lattner 6c0daf795a * 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

llvm-svn: 5223
2003-01-13 00:32:26 +00:00
Chris Lattner 26c23467c5 Rename FunctionFrameInfo to MachineFrameInfo
llvm-svn: 5201
2002-12-28 21:08:28 +00:00
Chris Lattner 51553e0700 * Use the new Abstract Frame Manager to handle incoming arguments and
fixed size allocas
* Revamp call emission to work with new frame manager

llvm-svn: 5178
2002-12-28 20:24:02 +00:00
Chris Lattner a76f456a60 * Simplify Value classes
* Add initial support for FP constants
* Add initial FP support for several instructions

llvm-svn: 5154
2002-12-25 05:13:53 +00:00
Chris Lattner cfcd0603d0 Changes to compile with GCC 2.96
Changes to support configurable pointer size and endianness

llvm-svn: 5130
2002-12-24 00:03:11 +00:00
Chris Lattner b437b7de1a Don't force setCC instructions into AL
llvm-svn: 5104
2002-12-18 01:44:31 +00:00
Chris Lattner 2e6f17f136 Build add instructions of the correct form!
llvm-svn: 5090
2002-12-16 23:36:57 +00:00
Chris Lattner e92fb346d3 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

llvm-svn: 5088
2002-12-16 22:54:46 +00:00
Chris Lattner e92f1bb011 Make sure stack manipulation refers to ESP the right number of times
llvm-svn: 5086
2002-12-16 22:29:06 +00:00
Chris Lattner 5c59014a1b Add some special cases to make common getelementptr cases easier to read/faster
llvm-svn: 5084
2002-12-16 19:32:50 +00:00
Brian Gaeke 6ebe959530 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.

llvm-svn: 5069
2002-12-16 04:23:29 +00:00