Commit Graph

5014 Commits

Author SHA1 Message Date
Dan Gohman a25dde6fee Handle getresult instructions in different basic blocks
from their aggregate operands by moving the getresult
instructions.

llvm-svn: 48657
2008-03-21 21:01:32 +00:00
Duncan Sands e37b9c0d34 Testcase for PR2160.
llvm-svn: 48655
2008-03-21 20:22:11 +00:00
Chris Lattner 5abbe6cef5 Add support for calls that return two FP values in
ST(0)/ST(1).

llvm-svn: 48634
2008-03-21 06:38:26 +00:00
Chris Lattner 7e59a30e9f disable a bogus assertion.
llvm-svn: 48633
2008-03-21 06:01:05 +00:00
Chris Lattner b6f04a3e0a Enable support for returning two long-double values in ST(0)/ST(1).
This allows us to compile fp-stack-2results.ll into:

_test:
	fldz
	fld1
	ret

which returns 1 in ST(0) and 0 in ST(1).  This is needed for x86-64
_Complex long double.

llvm-svn: 48632
2008-03-21 05:57:20 +00:00
Chris Lattner c44160ce6e Teach masked value is zero about add and sub, and use MVIZ to
simplify things like (X & 4) >> 1 == 2  --> (X & 4) == 4.

since it is obvious that the shift doesn't remove any bits.

llvm-svn: 48631
2008-03-21 05:19:58 +00:00
Evan Cheng 92b4488202 Undo 48570. Correctly match mmx shift instructions with an immediate operand.
llvm-svn: 48627
2008-03-21 00:40:09 +00:00
Evan Cheng 7a3e750fd2 Fix this xform: (sra (shl X, m), result_size) -> (sign_extend (trunc (shl X, result_size - n - m)))
llvm-svn: 48578
2008-03-20 02:18:41 +00:00
Devang Patel cbbf291f34 Keep track of analysis information inherited from Module pass manager.
llvm-svn: 48576
2008-03-20 01:09:53 +00:00
Scott Michel bbaf3edace Add more patterns to match in the integer comparison test harnesses.
Fix bugs encountered, mostly due to range matching for immediates;
the CellSPU's 10-bit immediates are sign extended, covering a
larger range of unsigned values.

llvm-svn: 48575
2008-03-20 00:51:36 +00:00
Evan Cheng bbba76fc99 Add intrinsics to match mmx shift builtin's with immediate operand.
llvm-svn: 48569
2008-03-19 23:38:52 +00:00
Dan Gohman b9056838d2 Add support for multiple return values for the PPC target by
converting call result lowering to use the CallingConvLowering
infastructure.

llvm-svn: 48552
2008-03-19 21:39:28 +00:00
Christopher Lamb 8fe9109469 Fix X86's isTruncateFree to not claim that truncate to i1 is free. This fixes Bill's testcase that failed for r48491.
llvm-svn: 48542
2008-03-19 08:30:06 +00:00
Tanya Lattner ab7872c06c Upgrade tests.
llvm-svn: 48538
2008-03-19 07:28:33 +00:00
Tanya Lattner f9d25185d5 Upgrade tests.
llvm-svn: 48536
2008-03-19 05:39:35 +00:00
Tanya Lattner 0ea4c8d706 Upgrade tests to not use llvm-upgrade.
llvm-svn: 48530
2008-03-19 04:36:04 +00:00
Tanya Lattner 1d526b90aa Upgrade tests to not use llvm-upgrade.
llvm-svn: 48529
2008-03-19 04:14:49 +00:00
Tanya Lattner f73582b17c Remove llvm-upgrade and update tests.
llvm-svn: 48527
2008-03-19 03:47:13 +00:00
Evan Cheng 56e9e57d28 Fixed a coalescer bug caused by a typo.
llvm-svn: 48526
2008-03-19 02:26:36 +00:00
Gordon Henriksen 265f780c22 C and Objective Caml bindings for the various getParent methods of the IR.
Based on Erick Tryzelaar's patch.

llvm-svn: 48523
2008-03-19 01:11:35 +00:00
Evan Cheng 44c0b4f754 Fix live variables issues:
1. If part of a register is re-defined, an implicit kill and an implicit def are added to denote read / mod / write. However, this should only be necessary if the register is actually read later. This is a performance issue.
2. If a sub-register is being defined, and it doesn't have a previous use, do not add a implicit kill to the last use of a super-register:
   = EAX, AX<imp-use,kill>
...
AX =
In this case, EAX is live but AX is killed, this is wrong and will cause the coalescer to do bad things.

llvm-svn: 48521
2008-03-19 00:52:20 +00:00
Evan Cheng 484064370a Fix a x86-64 isel lowering bug that's been around forever. A x86-64 varargs function implicitly reads X86::AL, don't clobber it!
llvm-svn: 48515
2008-03-18 23:36:35 +00:00
Bill Wendling 43784cc27d It might be nice to have this run as x86 on non-x86 platforms...
llvm-svn: 48511
2008-03-18 22:38:22 +00:00
Bill Wendling efb4d9ef80 Temporarily revert r48491. It's breaking test/CodeGen/X86/xorl.ll.
llvm-svn: 48510
2008-03-18 22:29:51 +00:00
Daniel Berlin 5fef9aea12 Fix PR 2160 by making sure arguments to external functions get marked as pointing to anything
llvm-svn: 48509
2008-03-18 22:22:53 +00:00
Tanya Lattner a043a9b0f0 Do not pass -g flag when compiling tests, so remove the C.Flags. This only happens if you have a debug build of llvm.
llvm-svn: 48498
2008-03-18 19:59:04 +00:00
Dale Johannesen 12c76db312 Make conversions of i8/i16 to ppcf128 work.
llvm-svn: 48493
2008-03-18 17:28:38 +00:00
Christopher Lamb 3e408d4d82 Target independent DAG transform to use truncate for field extraction + sign extend on targets where this is profitable. Passes nightly on x86-64.
llvm-svn: 48491
2008-03-18 16:46:39 +00:00
Evan Cheng d096ec0a86 Rewrite code that propagate isDead information after a dead copy is coalesced. This remove some ugly spaghetti code and fixed a number of subtle bugs.
llvm-svn: 48490
2008-03-18 08:26:47 +00:00
Tanya Lattner 4e59897d3d Upgrade tests to not use llvm-upgrade.
llvm-svn: 48484
2008-03-18 04:14:37 +00:00
Tanya Lattner baa370b37a Upgrade tests to not use llvm-upgrade.
llvm-svn: 48483
2008-03-18 03:45:45 +00:00
Chris Lattner 3b79fdcae5 ensure we continue matching x86-64 rotates.
llvm-svn: 48437
2008-03-17 01:35:03 +00:00
Gordon Henriksen ab4b7d36cd C and Objective Caml bindings for the TargetData class.
llvm-svn: 48422
2008-03-16 20:08:03 +00:00
Gordon Henriksen 82a0e74f43 C and Objective Caml bindings for several scalar transforms.
Patch originally by Erick Tryzelaar, but has been modified somewhat.

llvm-svn: 48419
2008-03-16 16:32:40 +00:00
Nick Lewycky ec6f1669d3 All of these tests had out of date syntax and were never even running through
llvm-upgrade because nobody noticed them failing.

Update to use new syntax and actually check for the right failure by looking at
the error message.

llvm-svn: 48417
2008-03-16 07:55:46 +00:00
Nick Lewycky 942035d8b3 Functions are allowed to return structures. (Note that this test never failed.)
llvm-svn: 48416
2008-03-16 07:49:49 +00:00
Nick Lewycky 227c7a290b Regressions/ is long gone.
llvm-svn: 48415
2008-03-16 07:31:23 +00:00
Gordon Henriksen 878114bf16 C and Objective Caml bindings for PassManagers.
llvm-svn: 48413
2008-03-16 04:20:44 +00:00
Evan Cheng 84aec09fdb Fix PR2138. Apparently any modification to a std::multimap (including remove entries for a different key) can invalidate multimap iterators.
llvm-svn: 48371
2008-03-14 20:44:01 +00:00
Bill Wendling 68a930b33e The inst combining of inttoptr into GEP with one index was using the bit size of
the type instead of the byte size. This was causing troublesome mis-compilations.

True to form, this took 2 days to find and is a one-line fix. :-P

llvm-svn: 48354
2008-03-14 05:12:19 +00:00
Dan Gohman b72127ac4c More APInt-ification.
llvm-svn: 48344
2008-03-13 22:13:53 +00:00
Owen Anderson 7a69e3aef3 Fix a bug in GVN that Duncan noticed, where we potentially need to insert a
pointer bitcast when performing return slot optimization.

llvm-svn: 48343
2008-03-13 22:07:10 +00:00
Tanya Lattner c21cfe37ec Fix error in testing for END. notation.
Patch by Julien Lerouge. Thanks!

llvm-svn: 48342
2008-03-13 22:02:51 +00:00
Evan Cheng 442d708bfb New test case.
llvm-svn: 48338
2008-03-13 08:05:02 +00:00
Evan Cheng ecde45ecb5 A test case I forgot to check in.
llvm-svn: 48335
2008-03-13 06:42:46 +00:00
Evan Cheng 5c26bde55e TwoAddressInstructionPass enhancement. After it converts a two address instruction into a 3-address one, sink it past the instruction that kills the read-mod-write register if its definition is used past the kill. This reduces the number of live register by one.
llvm-svn: 48333
2008-03-13 06:37:55 +00:00
Evan Cheng 65e9d5f1a8 Experimental scheduler change to schedule / coalesce the copies added for function livein's. Take 2008-03-10-RegAllocInfLoop.ll, the schedule looks like this after these copies are inserted:
entry: 0x12049d0, LLVM BB @0x1201fd0, ID#0:
Live Ins: %EAX %EDX %ECX
        %reg1031<def> = MOVPC32r 0
        %reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
        %reg1028<def> = MOV32rr %EAX
        %reg1029<def> = MOV32rr %EDX
        %reg1030<def> = MOV32rr %ECX
        %reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x1201910 + 0]
        %reg1025<def> = MOV32rr %reg1029
        %reg1026<def> = MOV32rr %reg1030
        %reg1024<def> = MOV32rr %reg1028

The copies unnecessarily increase register pressure and it will end up requiring a physical register to be spilled.

With -schedule-livein-copies:
entry: 0x12049d0, LLVM BB @0x1201fa0, ID#0:
Live Ins: %EAX %EDX %ECX
        %reg1031<def> = MOVPC32r 0
        %reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
        %reg1024<def> = MOV32rr %EAX
        %reg1025<def> = MOV32rr %EDX
        %reg1026<def> = MOV32rr %ECX
        %reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x12018e0 + 0]

Much better!

llvm-svn: 48307
2008-03-12 22:19:41 +00:00
Dan Gohman f7492cf0ec Fix this test on hosts that don't have sse2.
llvm-svn: 48296
2008-03-12 20:40:51 +00:00
Chris Lattner ee8d960ed1 no need to keep around this output.
llvm-svn: 48285
2008-03-12 17:14:06 +00:00
Owen Anderson 6ff0b822b4 Improve the return slot optimization to be both more aggressive (not limited to sret parameters), and
safer (when the passed pointer might be invalid).  Thanks to Duncan and Chris for the idea behind this, 
and extra thanks to Duncan for helping me work out the trap-safety.

llvm-svn: 48280
2008-03-12 07:37:44 +00:00