Commit Graph

4513 Commits

Author SHA1 Message Date
Evan Cheng
c92da3882e There are times when the coalescer would not coalesce away a copy but the copy
can be eliminated by the allocator is the destination and source targets the
same register. The most common case is when the source and destination registers
are in different class. For example, on x86 mov32to32_ targets GR32_ which
contains a subset of the registers in GR32.

The allocator can do 2 things:
1. Set the preferred allocation for the destination of a copy to that of its source.
2. After allocation is done, change the allocation of a copy destination (if
   legal) so the copy can be eliminated.

This eliminates 443 extra moves from 403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43662 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-03 07:20:12 +00:00
Evan Cheng
deb36bd9d4 Add run line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43645 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-02 17:36:58 +00:00
Evan Cheng
7277a7d031 One more extract_subreg coalescing bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43644 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-02 17:35:08 +00:00
Evan Cheng
9df7dc52e8 Missing a getNumOperands check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43630 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-02 01:26:22 +00:00
Owen Anderson
7ebba512c3 Fix test/Transforms/DeadStoreElimination/PartialStore.ll, which had been
silently failing because of an incorrect run line for some time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43605 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 05:29:16 +00:00
Dale Johannesen
df17df864f Test that expand_vector_elt(v2i64) works in 32-bit mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43598 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 02:38:24 +00:00
Chris Lattner
e41dcdc964 Fix InstCombine/2007-10-31-StringCrash.ll by removing an obvious
(in hindsight) infinite recursion.  Simplify the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43597 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 02:30:35 +00:00
Chris Lattner
74e012afd3 Fix InstCombine/2007-10-31-RangeCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43596 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 02:18:41 +00:00
Devang Patel
e45bb9ad5e New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43527 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 23:07:47 +00:00
Evan Cheng
8392772727 It's not safe to tell SplitCriticalEdge to merge identical edges. It may delete the phi instruction that's being processed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43524 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 22:27:26 +00:00
Dan Gohman
d61de35564 Add support for folding binary operators with vector zero operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 19:00:49 +00:00
Evan Cheng
af62c09437 - Bug fixes.
- Allow icmp rewrite using an iv / stride of a smaller integer type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43480 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 22:07:18 +00:00
Dan Gohman
090b38a0da Fix a DAGCombiner abort on a bitcast from a scalar to a vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43470 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 20:44:42 +00:00
Evan Cheng
3c3ddb3a85 Enable more fold (sext (load x)) -> (sext (truncate (sextload x)))
transformation. Previously, it's restricted by ensuring the number of load uses
is one. Now the restriction is loosened up by allowing setcc uses to be
"extended" (e.g. setcc x, c, eq -> setcc sext(x), sext(c), eq).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43465 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 19:58:20 +00:00
Chris Lattner
c20b0fbfcd update testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43452 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 17:06:35 +00:00
Chris Lattner
cee291c505 Model stacksave and stackrestore as both writing memory, since we
don't model their dependences on allocas correctly.  This fixes
PR1745.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43442 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 05:47:52 +00:00
Chris Lattner
fb7f343615 Add support for the x86-64 'q' regigster modifier, and add support for the
b/h/w/k/q inline asm memory modifiers, which are just ignored.  This fixes
PR1748 and CodeGen/X86/2007-10-28-inlineasm-q-modifier.ll



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43430 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 03:09:07 +00:00
Chris Lattner
b361ec3197 Fix PR1749 and InstCombine/2007-10-28-EmptyField.ll by handling
zero-length fields better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43427 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 02:40:02 +00:00
Chris Lattner
3cb63ddd51 Fix PR1752 and LoopSimplify/2007-10-28-InvokeCrash.ll: terminators
can have uses too.  Wouldn't it be nice if invoke didn't exist? :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43426 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 02:30:37 +00:00
Bill Wendling
318d3ae397 Test to make sure that if we have an unaligned memcpy, it will still compile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43412 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 23:43:35 +00:00
Bill Wendling
61297f960e On second thought. Remove this as it should never be generated in the first
place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43400 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 20:34:37 +00:00
Bill Wendling
984e986929 - Remove the hacky code that forces a memcpy. Alignment is taken care of in the
FE.
- Explicitly pass in the alignment of the load & store.
- XFAIL 2007-10-23-UnalignedMemcpy.ll because llc has a bug that crashes on
  unaligned pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43398 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 20:24:42 +00:00
Evan Cheng
2bd122c4d9 Loosen up iv reuse to allow reuse of the same stride but a larger type when truncating from the larger type to smaller type is free.
e.g.
Turns this loop:
LBB1_1: # entry.bb_crit_edge
        xorl    %ecx, %ecx
        xorw    %dx, %dx
        movw    %dx, %si
LBB1_2: # bb
        movl    L_X$non_lazy_ptr, %edi
        movw    %si, (%edi)
        movl    L_Y$non_lazy_ptr, %edi
        movw    %dx, (%edi)
		addw    $4, %dx
		incw    %si
		incl    %ecx
		cmpl    %eax, %ecx
		jne     LBB1_2  # bb
	
into

LBB1_1: # entry.bb_crit_edge
        xorl    %ecx, %ecx
        xorw    %dx, %dx
LBB1_2: # bb
        movl    L_X$non_lazy_ptr, %esi
        movw    %cx, (%esi)
        movl    L_Y$non_lazy_ptr, %esi
        movw    %dx, (%esi)
        addw    $4, %dx
		incl    %ecx
        cmpl    %eax, %ecx
        jne     LBB1_2  # bb


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43375 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 01:56:11 +00:00
Evan Cheng
cdf43b1fad If a loop termination compare instruction is the only use of its stride,
and the compaison is against a constant value, try eliminate the stride
by moving the compare instruction to another stride and change its
constant operand accordingly. e.g.

loop:
...
v1 = v1 + 3
v2 = v2 + 1
if (v2 < 10) goto loop
=>
loop:
...
v1 = v1 + 3
if (v1 < 30) goto loop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43336 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 09:11:16 +00:00
Owen Anderson
f92ff03f71 Fix for PR1741.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43326 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 02:36:18 +00:00
Dale Johannesen
691645e90f Testcase for PR 1397.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43323 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 00:50:14 +00:00
Dale Johannesen
0bd5fcf49f This was failing on Darwin, which defaults to PIC;
no lea was generated.  I think this follows the intent.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43312 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 20:58:14 +00:00
Chris Lattner
99c65745a2 Implement a couple of foldings for ordered and unordered comparisons,
implementing cases related to PR1738.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43289 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 05:38:08 +00:00
Bill Wendling
8b1c68cee4 If there's an unaligned memcpy to/from the stack, don't lower it. Just call the
memcpy library function instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43270 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:32:40 +00:00
Chris Lattner
a91547790b new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43252 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 18:07:23 +00:00
Chris Lattner
ee19b866c3 llvm/test programs should not be execution programs. This
will hopefully fix Gabor's Sparc problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43251 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 17:56:04 +00:00
Evan Cheng
152b7e1874 Temporary solution: added a different set of BCTRL_Macho / BCTRL_ELF with right callee-saved defs set for ppc64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43248 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 06:42:42 +00:00
Evan Cheng
4102eb57bb Fix memcpy lowering when addresses are 4-byte aligned but size is not multiple of 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 22:11:27 +00:00
Dan Gohman
02e4fa7d5f Strength reduction improvements.
- Avoid attempting stride-reuse in the case that there are users that
   aren't addresses. In that case, there will be places where the
   multiplications won't be folded away, so it's better to try to
   strength-reduce them.

 - Several SSE intrinsics have operands that strength-reduction can
   treat as addresses. The previous item makes this more visible, as
   any non-address use of an IV can inhibit stride-reuse.

 - Make ValidStride aware of whether there's likely to be a base
   register in the address computation. This prevents it from thinking
   that things like stride 9 are valid on x86 when the base register is
   already occupied.

Also, XFAIL the 2007-08-10-LEA16Use32.ll test; the new logic to avoid
stride-reuse elimintes the LEA in the loop, so the test is no longer
testing what it was intended to test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 20:40:42 +00:00
Dan Gohman
8368805e25 Fix the folding of multiplication into addresses on x86, which was broken
by the recent {U,S}MUL_LOHI changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43230 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 20:22:24 +00:00
Evan Cheng
3311876c3c Use ptr type in the immediate field of a BxA instruction so we don't end up selecting 32-bit call instruction for ppc64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43228 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 19:46:19 +00:00
Evan Cheng
40eaa99fa9 New test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43193 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 22:05:00 +00:00
Bill Wendling
80629c85f1 Don't branch fold inline asm statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 21:09:55 +00:00
Bill Wendling
4f78af8d77 Removed "-arch i386" by popular demand...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43186 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 18:49:16 +00:00
Bill Wendling
22058955e8 Now with RUN line!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43185 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 18:40:53 +00:00
Bill Wendling
8c0247d005 Remove the Foundation.h file because not everyone has that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43184 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 18:36:04 +00:00
Devang Patel
3305aaa350 This test now passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43183 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 17:11:01 +00:00
Rafael Espindola
618b0d59e6 Test byval with a 8 bit aligned struct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43173 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 11:29:21 +00:00
Rafael Espindola
5c0d6ed325 Add support for byval function whose argument is not 32 bit aligned.
To do this it is necessary to add a "always inline" argument to the
memcpy node. For completeness I have also added this node to memmove
and memset.  I have also added getMem* functions, because the extra
argument makes it cumbersome to use getNode and because I get confused
by it :-)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43172 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 10:41:11 +00:00
Devang Patel
95cf196d15 New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43162 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 01:28:02 +00:00
Chris Lattner
a0bc7fc7bd Fix PR1735 and Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll by
fixing some obviously broken code :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43141 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 18:49:29 +00:00
Bill Wendling
50c26b642c Fix the command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43140 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 18:26:40 +00:00
Devang Patel
45211d725b Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43136 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 17:54:49 +00:00
Bill Wendling
90bfc2d105 Pointer arithmetic should be done with the index the same size as the pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43120 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 08:32:37 +00:00
Evan Cheng
4ae31a5d32 Really fix PR1734. Carefully track which register uses are sub-register uses by
traversing inverse register coalescing map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43118 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 07:49:59 +00:00
Devang Patel
cd2858ee16 XFAIL for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43111 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 00:48:43 +00:00
Bill Wendling
d9417188f3 Test to make sure we don't generate unwind info for non-64-bit Objective-C.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43102 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 23:14:56 +00:00
Devang Patel
84458323a2 Do not raise free() call that is called through invoke instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43083 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 20:12:58 +00:00
Dan Gohman
c623096fe2 Add support for ISD::SELECT in SplitVectorOp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43072 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 14:48:28 +00:00
Devang Patel
afc407ea51 Apply "Instead of loading small c string constant, use integer constant directly" transformation while processing load instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43070 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 07:24:40 +00:00
Evan Cheng
234c6c6c25 Yet another test case for extract_subreg coalescing crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43063 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 02:15:06 +00:00
Evan Cheng
dcd8f78f8a Fix PR1734.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 19:29:47 +00:00
Dale Johannesen
cef254f8e1 New test for svn rev 43033, radar 5538745.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43034 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 18:10:14 +00:00
Chris Lattner
f602a25668 Fix a bug handling frame references in ppc inline asm when the frame offset
doesn't fit into 16 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43032 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 18:00:18 +00:00
Evan Cheng
87c8935fd5 LowerFP_TO_SINT must not create a stack object if it's not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43004 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 20:11:21 +00:00
Dan Gohman
f656b985ec Reapply the fix in 42908 for this file. This changes the function names
from "test" to "foo" so that they don't match the grep -i ST.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43001 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 19:22:17 +00:00
Evan Cheng
f5c7359afa Fix PR1729: watch out for val# with no def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42996 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 18:33:50 +00:00
Tanya Lattner
ba56fe801c Fix run line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42990 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 16:35:13 +00:00
Devang Patel
0eb3c86531 New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42986 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 15:41:07 +00:00
Evan Cheng
1074878fbf New test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42963 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 10:15:03 +00:00
Evan Cheng
347d39f1fd Revert 42908 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 05:57:21 +00:00
Chris Lattner
f8f7cf3987 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42953 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 06:56:18 +00:00
Evan Cheng
e765f8ed1a Fix test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42949 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 03:14:06 +00:00
Evan Cheng
5a68b285c0 New tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42948 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 03:10:54 +00:00
Dan Gohman
dfb6f13a45 Fix this test to not depend on the assembly output containing something
that includes the string "st". This probably fixes the regression on
Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42932 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 20:42:14 +00:00
Chris Lattner
a79dd432b3 Fix a bug in my patch last night that broke InstCombine/2007-10-12-Crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42920 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 18:05:47 +00:00
Dan Gohman
8ddde0a151 Change the names used for internal labels to use the current
function symbol name instead of a codegen-assigned function
number.

Thanks Evan! :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42908 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 14:53:36 +00:00
Evan Cheng
37a073eab4 Doh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42901 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 09:10:27 +00:00
Evan Cheng
dce05bc5ed EXTRACT_SUBREG test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42900 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 09:03:31 +00:00
Arnold Schwaighofer
a8e8864094 Added missing -march=x86 flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42893 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 07:49:48 +00:00
Chris Lattner
cb324cfc32 testcase for PR1728
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42890 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 05:29:53 +00:00
Dan Gohman
ac9385a555 Add intrinsics for sin, cos, and pow. These use llvm_anyfloat_ty, and so
may be overloaded with vector types. And add a testcase for codegen for
these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42885 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 00:01:22 +00:00
Dan Gohman
68ac767e1e Add an explicit target triple to make this test behave as expected on
non-Apple hosts. And use the count script instead of wc + grep.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:04:36 +00:00
Arnold Schwaighofer
c85e1716f0 Added tail call optimization to the x86 back end. It can be
enabled by passing -tailcallopt to llc.  The optimization is
performed if the following conditions are satisfied:
* caller/callee are fastcc
* elf/pic is disabled OR
  elf/pic enabled + callee is in module + callee has
  visibility protected or hidden


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42870 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 19:40:01 +00:00
Devang Patel
f9193de25b Lower memcpy if it makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42864 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 17:21:57 +00:00
Dan Gohman
dde01ec409 These two tests now require only two multiply instructions,
instead of four.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42784 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 15:39:37 +00:00
Evan Cheng
f6be158e9e Update test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42775 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 22:20:32 +00:00
Dan Gohman
b5d12c4438 These two tests now require only three multiply instructions,
instead of four.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42765 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 20:48:12 +00:00
Gordon Henriksen
2618a6c112 C and Objective Caml bindings for PHINode::addIncoming etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:14:39 +00:00
Gordon Henriksen
6d6203dff3 C and Objective Caml bindings for getFunction and getNamedGlobal. Also enhanced
the Objective Caml 'declare_*' functions to behave more or less like
getOrInsertFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 03:45:09 +00:00
Gordon Henriksen
c84c16be9b C and Objective Caml bindings for GlobalVariable::isConstant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42736 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 17:31:42 +00:00
Gordon Henriksen
1cf08fddc7 C and Objective Caml bindings for PATypeHolder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 00:13:35 +00:00
Gordon Henriksen
c0491ac8b6 Bindings for the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42707 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 21:00:36 +00:00
Gordon Henriksen
957f9fe1cc Adopting a uniform naming convention for type constructors in
bindings (part le deux).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42701 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 16:56:09 +00:00
Gordon Henriksen
e3b989d4a4 Adopting a uniform naming convention for constant constructors in bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 15:11:06 +00:00
Gordon Henriksen
4647569fe7 Adding C and Ocaml bindings for ConstantExpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42696 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 14:29:36 +00:00
Dale Johannesen
b762c086c8 Make test work on non-x86 hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42671 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 01:22:39 +00:00
Evan Cheng
bf287b63b3 Test case for 3-address conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42664 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 23:33:09 +00:00
Evan Cheng
ecf80ac68a Enable convertToThreeAddress for X86 by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42655 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 22:31:10 +00:00
Devang Patel
5c4cd0d82e Fix bug in updating dominance frontier after loop
unswitch when frontier includes basic blocks that 
are not inside loop.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42654 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 22:29:34 +00:00
Dale Johannesen
161e897b0f First round of ppc long double. call/return and
basic arithmetic works.
Rename RTLIB long double functions to distinguish
different flavors of long double; the lib functions
have different names, alas.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42644 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 20:04:43 +00:00
Evan Cheng
eca18214bb New test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42628 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:44:22 +00:00
Bill Wendling
5b095f2f02 Support Objective C++ too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42610 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 18:47:25 +00:00
Bill Wendling
14af7450c2 Added testcase for creation of metadata with null pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42609 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 18:46:06 +00:00
Bill Wendling
1f228360ec un-XFAIL this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42606 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 09:33:08 +00:00
Bill Wendling
17e0d894d5 Temporarily XFAIL this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42583 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 17:46:54 +00:00
Chris Lattner
4ec2c7eba0 testcase for PR1647
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42570 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 05:29:07 +00:00
Gordon Henriksen
6530e9d8e6 Add explicit --enable-bindings option to configure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42526 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 09:50:18 +00:00
Devang Patel
fdd7c6babf Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42522 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 00:47:43 +00:00
Devang Patel
d6f8ee7120 New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42517 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 00:39:19 +00:00
Evan Cheng
d18ba7c8de -pre-RA-sched=none, simple, simple-noitin are gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42505 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 22:17:20 +00:00
Devang Patel
4424757d3e PR 1603 test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42502 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 21:22:57 +00:00
Devang Patel
bc2265abe1 Relax unsafe use check. If there is one unconditional use inside the loop then it is safe to promote value even if there is another conditional use inside the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42493 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 18:12:58 +00:00
Devang Patel
fb71392848 Do not ignore packed member size while selecting union type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42458 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 23:54:26 +00:00
Dan Gohman
9fe4662d9a Teach SplitVectorOp how to split INSERT_VECTOR_ELT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42457 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 23:53:40 +00:00
Rafael Espindola
068317bfa3 Refactor the memcpy lowering for the x86 target.
The only generated code difference is that now we call memcpy when
the size of the array is unknown. This matches GCC behavior and is
better since the run time value can be arbitrarily large.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42433 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 12:53:01 +00:00
Dale Johannesen
317096ab37 Add sqrt and powi intrinsics for long double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42423 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 01:08:20 +00:00
Devang Patel
cdc52b0dd7 While searching for appropriate place for temporaries, do not over-incerement iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42406 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 18:02:47 +00:00
Chris Lattner
b1ab71d997 new testcase for PR1708
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42398 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 15:47:16 +00:00
Nick Lewycky
9a2f93121b Build the correct range for loops with unusual bounds. Fix from Jay Foad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42394 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 14:12:54 +00:00
Dale Johannesen
fe5293daa2 Modernize fabs.ll, add long double. Add tests
for direct codegen of fsin/fcos.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42369 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 21:12:10 +00:00
Gordon Henriksen
46abf91f73 Added C and Ocaml bindings for functions, basic blocks, and
instruction creation. No support yet for instruction introspection.

Also eliminated allocas from the Ocaml bindings for portability,
and avoided unnecessary casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42367 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 20:56:12 +00:00
Duncan Sands
0d91645ba4 Test the C front-end, not the C++ front-end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42350 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 07:28:20 +00:00
Duncan Sands
ca9976d6fe Test that local variables are aligned as the user requested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42338 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 04:04:29 +00:00
Devang Patel
a6dff2faeb Handle multiple induction variables.
This fixes PR714.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42309 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 18:24:48 +00:00
Dan Gohman
a37c9f7506 When both x/y and x%y are needed (x and y both scalar integer), compute
both results with a single div or idiv instruction. This uses new X86ISD
nodes for DIV and IDIV which are introduced during the legalize phase
so that the SelectionDAG's CSE can automatically eliminate redundant
computations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42308 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 18:23:27 +00:00
Dale Johannesen
2246bb6011 Some tests for APFloat conversions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42303 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 17:50:55 +00:00
Evan Cheng
6ee23ad74b Forgot to check in the changes. Fix test case so it doesn't break with any scheduling changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42302 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 17:47:38 +00:00
Devang Patel
453a844128 Add transformation to update loop interation space. Now,
for (i=A; i<N; i++) {
  if (i < X && i > Y)
    do_something();
}

is transformed into

U=min(N,X); L=max(A,Y);
for (i=L;i<U;i++)
  do_somethihg();                            



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42299 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 17:31:19 +00:00
Devang Patel
128459b85b Do not promote null values because it may be unsafe to do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42270 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 20:02:42 +00:00
Tanya Lattner
06611dfbdf XFAIL for llvm-gcc4.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 17:14:53 +00:00
Dan Gohman
e40c7b0973 Use the correct result value type instead of using getValueType(0)
in ExpandEXTRACT_VECTOR_ELT and SplitVectorOp. This fixes an abort
in the included testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42264 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 15:54:53 +00:00
Dan Gohman
ea81d095dc Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42263 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 15:50:11 +00:00
Dale Johannesen
c557a9c00a Implementation of +sse -sse2 has changed; add
-sse to preserve intent of this test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42247 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-23 14:58:14 +00:00
Devang Patel
3f65f02d25 Fix PR1692
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42209 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-21 21:18:19 +00:00
Chris Lattner
68471d5289 gcroot testcase, patch by Eric Christopher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42198 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-21 17:48:39 +00:00
Rafael Espindola
a37ac9ff53 Don't add a default STACK_ALIGN (use the generic ABI alignment)
Implement calls to functions with byval arguments on X86


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42192 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-21 15:50:22 +00:00
Duncan Sands
d7944ca61c Testcase for PR1678.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42171 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 18:56:24 +00:00
Evan Cheng
b7c8017208 Disable if-conversion for this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42170 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 18:06:22 +00:00
Evan Cheng
4226689f44 -enable-arm-if-conversion is gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42169 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 18:03:23 +00:00
Gordon Henriksen
a8c3660c1a Incorporating review feedback for GC verifier patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42163 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 16:47:41 +00:00
Dan Gohman
a4ddacf60b Fix several more entries in the x86 reload/remat folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42162 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 14:17:21 +00:00
Nick Lewycky
1af92b05d5 Excuse me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 00:57:00 +00:00
Nick Lewycky
e29578afd5 Fix optimization. %x = sub %x, %y does not imply that %y is zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 00:48:36 +00:00
Devang Patel
f2038b1d93 Avoid unsafe promotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42149 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 20:18:51 +00:00
Duncan Sands
437c27cd9d Testcase for PR1678.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42128 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 07:43:17 +00:00
Evan Cheng
921c85c487 Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42112 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 22:56:31 +00:00
Evan Cheng
e0480d2ec2 Fix a bogus splat xform:
shuffle <undef, undef, x, undef>, <undef, undef, undef, undef>, <2, 2, 2, 2>
!=
<undef, undef, x, undef>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42111 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 21:54:37 +00:00
Gabor Greif
d84c3ab4a7 rename test, it is obviously misspelled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 21:42:39 +00:00
Gordon Henriksen
344be5fbec Tests of the ocaml (and thus C) bindings for constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42101 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 18:07:51 +00:00
Gordon Henriksen
8ef426baa3 Adding ocaml language bindings for the vmcore and bitwriter libraries. These are
built atop the C language bindings, and user programs can link with them as 
such:

  # Bytecode
  ocamlc -cc g++ llvm.cma llvmbitwriter.cma -o example example.ml
  # Native
  ocamlopt -cc g++ llvm.cmxa llvmbitwriter.cmxa -o example.opt example.ml

The vmcore.ml test exercises most/all of the APIs thus far bound. Unfortunately,
they're not yet numerous enough to write hello world. But:

  $ cat example.ml
  (* example.ml *)
  
  open Llvm
  open Llvm_bitwriter
  
  let _ =
    let filename = Sys.argv.(1) in
    let m = create_module filename in
    
    let v = make_int_constant i32_type 42 false in
    let g = define_global "hello_world" v m in
    
    if not (write_bitcode_file m filename) then exit 1;
    
    dispose_module m;

  $ ocamlc -cc g++ llvm.cma llvm_bitwriter.cma -o example example.ml
  File "example.ml", line 11, characters 6-7:
  Warning Y: unused variable g.
  $ ./example example.bc
  $ llvm-dis < example.bc
  ; ModuleID = '<stdin>'
  @hello_world = global i32 42            ; <i32*> [#uses=0]

The ocaml test cases provide effective tests for the C interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42093 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 12:49:39 +00:00
Gordon Henriksen
0908d49c22 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42090 91177308-0d34-0410-b5e6-96231b3b80d8 2007-09-18 12:26:17 +00:00
Devang Patel
e3bfb88898 Fix PR1657
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42075 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 01:54:42 +00:00
Bill Wendling
6e19896999 Objective-C was generating EH frame info like this:
"_-[NSString(local) isNullOrNil]".eh = 0
        .no_dead_strip  "_-[NSString(local) isNullOrNil]".eh

The ".eh" should be inside the quotes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42074 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18 01:47:22 +00:00
Gordon Henriksen
8c33da5dc4 Fix for PR1633: Verifier doesn't fully verify GC intrinsics
LLVM now enforces the following prototypes for the write barriers:

<ty>* @llvm.gcread(<ty2>*, <ty>**)
void @llvm.gcwrite(<ty>*, <ty2>*, <ty>**)

And for @llvm.gcroot, the first stack slot is verified to be an alloca or a 
bitcast of an alloca.

Fixes test/CodeGen/Generic/GC/lower_gcroot.ll, which violated these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17 20:30:04 +00:00