Commit Graph

4647 Commits

Author SHA1 Message Date
Anton Korobeynikov 2c6387803e Fix PIC jump table codegen on x86-32/linux. In fact, such thing should be applied
to all targets uses GOT-relative offsets for PIC (Alpha?)

llvm-svn: 44108
2007-11-14 09:18:41 +00:00
Duncan Sands 9c30fc234c XFAIL these tests until the fix gets backported
from llvm-gcc-4.2 to 4.0.

llvm-svn: 44103
2007-11-14 07:42:50 +00:00
Chris Lattner a77e74edba Implement PR1796 and Transforms/SimplifyCFG/noreturn-call.ll
by inserting unreachable after no-return calls.

llvm-svn: 44099
2007-11-14 06:19:25 +00:00
Chris Lattner f150ace6cb upgrade test
llvm-svn: 44067
2007-11-13 21:42:48 +00:00
Chris Lattner 61ce4dff7a Implement PR1786 by iterating between dead cycle elimination
and simplifycfg in the rare cases when it is needed.

llvm-svn: 44044
2007-11-13 07:32:38 +00:00
Arnold Schwaighofer d2c16ff905 Update tailcall code to include inline attribute operand for memcpy.
llvm-svn: 43978
2007-11-10 10:48:01 +00:00
Evan Cheng 05b94b8c13 Fix tests.
llvm-svn: 43961
2007-11-09 20:46:00 +00:00
Chris Lattner f9c0fd7488 Tighten up a check for folding away loads from (newly constant) globals. This
fixes a crash on Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll and 
rdar://5585488.

llvm-svn: 43949
2007-11-09 17:33:02 +00:00
Duncan Sands 303a5d6c8b Thanks to the XTARGET line, this test should still
be run on darwin, but I have no way of checking...

llvm-svn: 43945
2007-11-09 13:50:25 +00:00
Duncan Sands 0c7fba914d Check that the first and third characters, s and u,
are accessed with an alignment of 2 not 1.

llvm-svn: 43932
2007-11-09 07:47:29 +00:00
Duncan Sands 1445725759 Check that accesses to the second short, t, have
an alignment of 2 rather than 4.

llvm-svn: 43931
2007-11-09 07:46:02 +00:00
Devang Patel 94785aa1c7 Run this test only on darwin.
llvm-svn: 43912
2007-11-08 22:26:46 +00:00
Andrew Lenharth 19ca5c7021 Better check
llvm-svn: 43897
2007-11-08 18:45:15 +00:00
Andrew Lenharth 8cf11aa330 Fix PR1780
llvm-svn: 43893
2007-11-08 17:39:28 +00:00
Lauro Ramos Venancio f6a67bf700 [ARM] Implement __builtin_thread_pointer.
llvm-svn: 43892
2007-11-08 17:20:05 +00:00
Evan Cheng ece4c68b82 If both parts of smul_lohi, etc. are used, don't simplify. If only one part is used, try simplify it.
llvm-svn: 43888
2007-11-08 09:25:29 +00:00
Bill Wendling 6e976915a3 Add testcase
llvm-svn: 43839
2007-11-07 19:36:26 +00:00
Tanya Lattner 5de0daf6b1 Implement the XTARGET feature for PR1778
This will mark a test as PASS for all targets specified. It will override whatever is in XFAIL.

llvm-svn: 43788
2007-11-06 22:32:17 +00:00
Chris Lattner d8515f8e80 Implement PR1777 by detecting dependent phis that
all compute the same value.

llvm-svn: 43777
2007-11-06 21:52:06 +00:00
Evan Cheng 2dbffa4e76 Add pseudo dependency to force two-address instruction to be scheduled after
other uses. There was a overly restricted check that prevented some obvious
cases.

llvm-svn: 43762
2007-11-06 08:44:59 +00:00
Chris Lattner 0fc613b85d Fix PR1774 and BasicAA/2007-11-05-SizeCrash.ll
llvm-svn: 43756
2007-11-06 05:58:42 +00:00
Dan Gohman 08143e397d Add support for vector remainder operations.
llvm-svn: 43744
2007-11-05 23:35:22 +00:00
Dan Gohman 4decbc5002 Fix an abort in instcombine when folding creates a vector rem instruction.
llvm-svn: 43743
2007-11-05 23:16:33 +00:00
Dale Johannesen 4646aa3e33 Make labels work in asm blocks; allow labels as
parameters.  Rename ValueRefList to ParamList
in AsmParser, since its only use is for parameters.

llvm-svn: 43734
2007-11-05 21:20:28 +00:00
Devang Patel b98d2050a2 If a value is incoming from outside the loop then the value does not need remapping and the value is never tracked through LastValueMap.
llvm-svn: 43728
2007-11-05 19:32:30 +00:00
Lauro Ramos Venancio 1a30c18e88 [ARM] Fix code generation for:
static __thread struct {
    int a;
    int b;
} teste = {0, 0};

llvm-svn: 43722
2007-11-05 18:33:37 +00:00
Evan Cheng 17b0e3e1ae Skip over deleted val#'s.
llvm-svn: 43700
2007-11-05 06:46:45 +00:00
Evan Cheng a406b47f14 Handle cases where a register and one of its super-register are both marked as
defined on the same instruction. This fixes PR1767.

llvm-svn: 43699
2007-11-05 03:11:55 +00:00
Evan Cheng e12363dac5 Fix test case. Chris didn't do make check. :-)
llvm-svn: 43698
2007-11-05 03:04:26 +00:00
Evan Cheng c68023a955 Doh. PR1187 -> PR1766.
llvm-svn: 43693
2007-11-05 01:00:44 +00:00
Evan Cheng a8044084ac Fix PR1187.
llvm-svn: 43692
2007-11-05 00:59:10 +00:00
Chris Lattner 9329e780cd Fix PR1761 by not printing (rip) suffix when in -static mode.
Evan, please review this.

llvm-svn: 43680
2007-11-04 19:23:28 +00:00
Duncan Sands 399d97987b Change uses of getTypeSize to getABITypeSize, getTypeStoreSize
or getTypeSizeInBits as appropriate in ScalarReplAggregates.
The right change to make was not always obvious, so it would
be good to have an sroa guru review this.  While there I noticed
some bugs, and fixed them: (1) arrays of x86 long double have
holes due to alignment padding, but this wasn't being spotted
by HasStructPadding (renamed to HasPadding).  The same goes
for arrays of oddly sized ints.  Vectors also suffer from this,
in fact the problem for vectors is much worse because basic
vector assumptions seem to be broken by vectors of type with
alignment padding.   I didn't try to fix any of these vector
problems.  (2) The code for extracting smaller integers from
larger ones (in the "int union" case) was wrong on big-endian
machines for integers with size not a multiple of 8, like i1.
Probably this is impossible to hit via llvm-gcc, but I fixed
it anyway while there and added a testcase.  I also got rid of
some trailing whitespace and changed a function name which
had an obvious typo in it.

llvm-svn: 43672
2007-11-04 14:43:57 +00:00
Chris Lattner 296160d443 Fix PR1763 by allowing the 'q' constraint to work with 64-bit
regs on x86-64.

llvm-svn: 43669
2007-11-04 06:51:12 +00:00
Evan Cheng 66298e226f 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.

llvm-svn: 43662
2007-11-03 07:20:12 +00:00
Evan Cheng 0442889b18 Add run line.
llvm-svn: 43645
2007-11-02 17:36:58 +00:00
Evan Cheng f851163c53 One more extract_subreg coalescing bug.
llvm-svn: 43644
2007-11-02 17:35:08 +00:00
Evan Cheng e453ff4913 Missing a getNumOperands check.
llvm-svn: 43630
2007-11-02 01:26:22 +00:00
Owen Anderson 2ed651ace7 Fix test/Transforms/DeadStoreElimination/PartialStore.ll, which had been
silently failing because of an incorrect run line for some time.

llvm-svn: 43605
2007-11-01 05:29:16 +00:00
Dale Johannesen 440f9abab4 Test that expand_vector_elt(v2i64) works in 32-bit mode.
llvm-svn: 43598
2007-11-01 02:38:24 +00:00
Chris Lattner 6ab19ed78d Fix InstCombine/2007-10-31-StringCrash.ll by removing an obvious
(in hindsight) infinite recursion.  Simplify the code.

llvm-svn: 43597
2007-11-01 02:30:35 +00:00
Chris Lattner 74709473ed Fix InstCombine/2007-10-31-RangeCrash.ll
llvm-svn: 43596
2007-11-01 02:18:41 +00:00
Devang Patel 17833d7068 New test.
llvm-svn: 43527
2007-10-30 23:07:47 +00:00
Evan Cheng c2dbfee43f It's not safe to tell SplitCriticalEdge to merge identical edges. It may delete the phi instruction that's being processed.
llvm-svn: 43524
2007-10-30 22:27:26 +00:00
Dan Gohman 9f39660c20 Add support for folding binary operators with vector zero operands.
llvm-svn: 43510
2007-10-30 19:00:49 +00:00
Evan Cheng b024c4c81d - Bug fixes.
- Allow icmp rewrite using an iv / stride of a smaller integer type.

llvm-svn: 43480
2007-10-29 22:07:18 +00:00
Dan Gohman ae95d72a52 Fix a DAGCombiner abort on a bitcast from a scalar to a vector.
llvm-svn: 43470
2007-10-29 20:44:42 +00:00
Evan Cheng e106e2f142 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).

llvm-svn: 43465
2007-10-29 19:58:20 +00:00
Chris Lattner 00860d7574 update testcase
llvm-svn: 43452
2007-10-29 17:06:35 +00:00
Chris Lattner c541c3ee15 Model stacksave and stackrestore as both writing memory, since we
don't model their dependences on allocas correctly.  This fixes
PR1745.

llvm-svn: 43442
2007-10-29 05:47:52 +00:00
Chris Lattner 5e99fd8c0d 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

llvm-svn: 43430
2007-10-29 03:09:07 +00:00
Chris Lattner 9a641510bd Fix PR1749 and InstCombine/2007-10-28-EmptyField.ll by handling
zero-length fields better.

llvm-svn: 43427
2007-10-29 02:40:02 +00:00
Chris Lattner 4a15e04aee Fix PR1752 and LoopSimplify/2007-10-28-InvokeCrash.ll: terminators
can have uses too.  Wouldn't it be nice if invoke didn't exist? :)

llvm-svn: 43426
2007-10-29 02:30:37 +00:00
Bill Wendling 2305de81a4 Test to make sure that if we have an unaligned memcpy, it will still compile.
llvm-svn: 43412
2007-10-26 23:43:35 +00:00
Bill Wendling b0bfd69684 On second thought. Remove this as it should never be generated in the first
place.

llvm-svn: 43400
2007-10-26 20:34:37 +00:00
Bill Wendling 6d15b32c15 - 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.

llvm-svn: 43398
2007-10-26 20:24:42 +00:00
Evan Cheng 7f3d02471d 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

llvm-svn: 43375
2007-10-26 01:56:11 +00:00
Evan Cheng 133694db06 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

llvm-svn: 43336
2007-10-25 09:11:16 +00:00
Owen Anderson 7827a3f366 Fix for PR1741.
llvm-svn: 43326
2007-10-25 02:36:18 +00:00
Dale Johannesen ea839ef1f0 Testcase for PR 1397.
llvm-svn: 43323
2007-10-25 00:50:14 +00:00
Dale Johannesen 52bbe1b171 This was failing on Darwin, which defaults to PIC;
no lea was generated.  I think this follows the intent.

llvm-svn: 43312
2007-10-24 20:58:14 +00:00
Chris Lattner c62877e9da Implement a couple of foldings for ordered and unordered comparisons,
implementing cases related to PR1738.

llvm-svn: 43289
2007-10-24 05:38:08 +00:00
Bill Wendling e3b859298a If there's an unaligned memcpy to/from the stack, don't lower it. Just call the
memcpy library function instead.

llvm-svn: 43270
2007-10-23 23:32:40 +00:00
Chris Lattner 07ae732cc4 new testcase
llvm-svn: 43252
2007-10-23 18:07:23 +00:00
Chris Lattner 788f0d340a llvm/test programs should not be execution programs. This
will hopefully fix Gabor's Sparc problem.

llvm-svn: 43251
2007-10-23 17:56:04 +00:00
Evan Cheng ec271b104c Temporary solution: added a different set of BCTRL_Macho / BCTRL_ELF with right callee-saved defs set for ppc64.
llvm-svn: 43248
2007-10-23 06:42:42 +00:00
Evan Cheng 1f2dd35898 Fix memcpy lowering when addresses are 4-byte aligned but size is not multiple of 4.
llvm-svn: 43234
2007-10-22 22:11:27 +00:00
Dan Gohman e0c3d9f338 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.

llvm-svn: 43231
2007-10-22 20:40:42 +00:00
Dan Gohman bf474959a3 Fix the folding of multiplication into addresses on x86, which was broken
by the recent {U,S}MUL_LOHI changes.

llvm-svn: 43230
2007-10-22 20:22:24 +00:00
Evan Cheng bdbed66333 Use ptr type in the immediate field of a BxA instruction so we don't end up selecting 32-bit call instruction for ppc64.
llvm-svn: 43228
2007-10-22 19:46:19 +00:00
Evan Cheng f52a6fc50c New test case.
llvm-svn: 43193
2007-10-19 22:05:00 +00:00
Bill Wendling ac5c93040f Don't branch fold inline asm statements.
llvm-svn: 43191
2007-10-19 21:09:55 +00:00
Bill Wendling b5bc897864 Removed "-arch i386" by popular demand...
llvm-svn: 43186
2007-10-19 18:49:16 +00:00
Bill Wendling 5f1a253a3f Now with RUN line!
llvm-svn: 43185
2007-10-19 18:40:53 +00:00
Bill Wendling 89151b1f0a Remove the Foundation.h file because not everyone has that.
llvm-svn: 43184
2007-10-19 18:36:04 +00:00
Devang Patel c0ced49a14 This test now passes.
llvm-svn: 43183
2007-10-19 17:11:01 +00:00
Rafael Espindola 813a0b1d29 Test byval with a 8 bit aligned struct
llvm-svn: 43173
2007-10-19 11:29:21 +00:00
Rafael Espindola 846c19dd70 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 :-)

llvm-svn: 43172
2007-10-19 10:41:11 +00:00
Devang Patel e1b7fa3410 New test.
llvm-svn: 43162
2007-10-19 01:28:02 +00:00
Chris Lattner 9715d9fb59 Fix PR1735 and Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll by
fixing some obviously broken code :(

llvm-svn: 43141
2007-10-18 18:49:29 +00:00
Bill Wendling 5616a608df Fix the command line.
llvm-svn: 43140
2007-10-18 18:26:40 +00:00
Devang Patel 371a5ef1de Fix test.
llvm-svn: 43136
2007-10-18 17:54:49 +00:00
Bill Wendling 070aca5d25 Pointer arithmetic should be done with the index the same size as the pointer.
llvm-svn: 43120
2007-10-18 08:32:37 +00:00
Evan Cheng e6a41c066a Really fix PR1734. Carefully track which register uses are sub-register uses by
traversing inverse register coalescing map.

llvm-svn: 43118
2007-10-18 07:49:59 +00:00
Devang Patel 9497767458 XFAIL for now.
llvm-svn: 43111
2007-10-18 00:48:43 +00:00
Bill Wendling 37f888e6e8 Test to make sure we don't generate unwind info for non-64-bit Objective-C.
llvm-svn: 43102
2007-10-17 23:14:56 +00:00
Devang Patel b3dac3f5d9 Do not raise free() call that is called through invoke instruction.
llvm-svn: 43083
2007-10-17 20:12:58 +00:00
Dan Gohman 8f518b9875 Add support for ISD::SELECT in SplitVectorOp.
llvm-svn: 43072
2007-10-17 14:48:28 +00:00
Devang Patel 91ff13edcc Apply "Instead of loading small c string constant, use integer constant directly" transformation while processing load instruction.
llvm-svn: 43070
2007-10-17 07:24:40 +00:00
Evan Cheng 7587d1bd19 Yet another test case for extract_subreg coalescing crash.
llvm-svn: 43063
2007-10-17 02:15:06 +00:00
Evan Cheng fab7ca89d5 Fix PR1734.
llvm-svn: 43035
2007-10-16 19:29:47 +00:00
Dale Johannesen e43b960d3b New test for svn rev 43033, radar 5538745.
llvm-svn: 43034
2007-10-16 18:10:14 +00:00
Chris Lattner 1366653e2f Fix a bug handling frame references in ppc inline asm when the frame offset
doesn't fit into 16 bits.

llvm-svn: 43032
2007-10-16 18:00:18 +00:00
Evan Cheng 7bcfd8f880 LowerFP_TO_SINT must not create a stack object if it's not needed.
llvm-svn: 43004
2007-10-15 20:11:21 +00:00
Dan Gohman e862243e1c 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.

llvm-svn: 43001
2007-10-15 19:22:17 +00:00
Evan Cheng a5abba65b6 Fix PR1729: watch out for val# with no def.
llvm-svn: 42996
2007-10-15 18:33:50 +00:00
Tanya Lattner 9486b19066 Fix run line.
llvm-svn: 42990
2007-10-15 16:35:13 +00:00
Devang Patel 80b1222274 New test.
llvm-svn: 42986
2007-10-15 15:41:07 +00:00
Evan Cheng d8771e915c New test case.
llvm-svn: 42963
2007-10-14 10:15:03 +00:00
Evan Cheng cdf3609130 Revert 42908 for now.
llvm-svn: 42960
2007-10-14 05:57:21 +00:00
Chris Lattner 2ce649ebea new testcase
llvm-svn: 42953
2007-10-13 06:56:18 +00:00
Evan Cheng f86204baf4 Fix test case.
llvm-svn: 42949
2007-10-13 03:14:06 +00:00
Evan Cheng 54bec86754 New tests.
llvm-svn: 42948
2007-10-13 03:10:54 +00:00
Dan Gohman e0ad9ea7cd Fix this test to not depend on the assembly output containing something
that includes the string "st". This probably fixes the regression on
Darwin.

llvm-svn: 42932
2007-10-12 20:42:14 +00:00
Chris Lattner ad618f66e6 Fix a bug in my patch last night that broke InstCombine/2007-10-12-Crash.ll
llvm-svn: 42920
2007-10-12 18:05:47 +00:00
Dan Gohman dc35bd79ca Change the names used for internal labels to use the current
function symbol name instead of a codegen-assigned function
number.

Thanks Evan! :-)

llvm-svn: 42908
2007-10-12 14:53:36 +00:00
Evan Cheng f8e28b152a Doh.
llvm-svn: 42901
2007-10-12 09:10:27 +00:00
Evan Cheng b83a379f4f EXTRACT_SUBREG test case.
llvm-svn: 42900
2007-10-12 09:03:31 +00:00
Arnold Schwaighofer 9653e677d5 Added missing -march=x86 flag.
llvm-svn: 42893
2007-10-12 07:49:48 +00:00
Chris Lattner 3e99eb25ee testcase for PR1728
llvm-svn: 42890
2007-10-12 05:29:53 +00:00
Dan Gohman be37007e64 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.

llvm-svn: 42885
2007-10-12 00:01:22 +00:00
Dan Gohman 3554448947 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.

llvm-svn: 42878
2007-10-11 23:04:36 +00:00
Arnold Schwaighofer 9ccea99165 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

llvm-svn: 42870
2007-10-11 19:40:01 +00:00
Devang Patel 899cc56612 Lower memcpy if it makes sense.
llvm-svn: 42864
2007-10-11 17:21:57 +00:00
Dan Gohman 678387a299 These two tests now require only two multiply instructions,
instead of four.

llvm-svn: 42784
2007-10-09 15:39:37 +00:00
Evan Cheng 3b3e6097a3 Update test.
llvm-svn: 42775
2007-10-08 22:20:32 +00:00
Dan Gohman a24b431b27 These two tests now require only three multiply instructions,
instead of four.

llvm-svn: 42765
2007-10-08 20:48:12 +00:00
Gordon Henriksen 44dd8fbd26 C and Objective Caml bindings for PHINode::addIncoming etc.
llvm-svn: 42760
2007-10-08 18:14:39 +00:00
Gordon Henriksen 783f7bbabd C and Objective Caml bindings for getFunction and getNamedGlobal. Also enhanced
the Objective Caml 'declare_*' functions to behave more or less like
getOrInsertFunction.

llvm-svn: 42740
2007-10-08 03:45:09 +00:00
Gordon Henriksen 751ebf7b9a C and Objective Caml bindings for GlobalVariable::isConstant.
llvm-svn: 42736
2007-10-07 17:31:42 +00:00
Gordon Henriksen ffb4876cfb C and Objective Caml bindings for PATypeHolder.
llvm-svn: 42713
2007-10-07 00:13:35 +00:00
Gordon Henriksen c3d661a0ee Bindings for the verifier.
llvm-svn: 42707
2007-10-06 21:00:36 +00:00
Gordon Henriksen fc560cef9a Adopting a uniform naming convention for type constructors in
bindings (part le deux).

llvm-svn: 42701
2007-10-06 16:56:09 +00:00
Gordon Henriksen 1046c73d12 Adopting a uniform naming convention for constant constructors in bindings.
llvm-svn: 42697
2007-10-06 15:11:06 +00:00
Gordon Henriksen 7ce3176696 Adding C and Ocaml bindings for ConstantExpr.
llvm-svn: 42696
2007-10-06 14:29:36 +00:00
Dale Johannesen bcfa7c1255 Make test work on non-x86 hosts.
llvm-svn: 42671
2007-10-06 01:22:39 +00:00
Evan Cheng 5ee9cf6bca Test case for 3-address conversion.
llvm-svn: 42664
2007-10-05 23:33:09 +00:00
Evan Cheng 484cab7a2f Enable convertToThreeAddress for X86 by default.
llvm-svn: 42655
2007-10-05 22:31:10 +00:00
Devang Patel a69f987b66 Fix bug in updating dominance frontier after loop
unswitch when frontier includes basic blocks that 
are not inside loop.

llvm-svn: 42654
2007-10-05 22:29:34 +00:00
Dale Johannesen c0154c06d6 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.

llvm-svn: 42644
2007-10-05 20:04:43 +00:00
Evan Cheng 90a4185b5f New test case.
llvm-svn: 42628
2007-10-05 01:44:22 +00:00
Bill Wendling eaa909f08e Support Objective C++ too.
llvm-svn: 42610
2007-10-04 18:47:25 +00:00
Bill Wendling c20518d0df Added testcase for creation of metadata with null pointers.
llvm-svn: 42609
2007-10-04 18:46:06 +00:00
Bill Wendling 2fba4a85ea un-XFAIL this test.
llvm-svn: 42606
2007-10-04 09:33:08 +00:00
Bill Wendling 354504060c Temporarily XFAIL this test.
llvm-svn: 42583
2007-10-03 17:46:54 +00:00
Chris Lattner b511029eaf testcase for PR1647
llvm-svn: 42570
2007-10-03 05:29:07 +00:00
Gordon Henriksen d48f4598a4 Add explicit --enable-bindings option to configure.
llvm-svn: 42526
2007-10-02 09:50:18 +00:00
Devang Patel 18c2fa7225 Fix test.
llvm-svn: 42522
2007-10-02 00:47:43 +00:00
Devang Patel 0d4958f1b0 New test.
llvm-svn: 42517
2007-10-02 00:39:19 +00:00
Evan Cheng 89ca5b091f -pre-RA-sched=none, simple, simple-noitin are gone.
llvm-svn: 42505
2007-10-01 22:17:20 +00:00
Devang Patel e595d107e6 PR 1603 test case.
llvm-svn: 42502
2007-10-01 21:22:57 +00:00
Devang Patel 2a60ff1aeb 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.
llvm-svn: 42493
2007-10-01 18:12:58 +00:00
Devang Patel f96df8d777 Do not ignore packed member size while selecting union type.
llvm-svn: 42458
2007-09-28 23:54:26 +00:00
Dan Gohman a90183e7d1 Teach SplitVectorOp how to split INSERT_VECTOR_ELT.
llvm-svn: 42457
2007-09-28 23:53:40 +00:00
Rafael Espindola 6c04ac1db0 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.

llvm-svn: 42433
2007-09-28 12:53:01 +00:00
Dale Johannesen 25a00a63eb Add sqrt and powi intrinsics for long double.
llvm-svn: 42423
2007-09-28 01:08:20 +00:00
Devang Patel f68d3e1a0d While searching for appropriate place for temporaries, do not over-incerement iterator.
llvm-svn: 42406
2007-09-27 18:02:47 +00:00
Chris Lattner d2bc9d8c77 new testcase for PR1708
llvm-svn: 42398
2007-09-27 15:47:16 +00:00
Nick Lewycky 3934961878 Build the correct range for loops with unusual bounds. Fix from Jay Foad.
llvm-svn: 42394
2007-09-27 14:12:54 +00:00
Dale Johannesen b805d35d16 Modernize fabs.ll, add long double. Add tests
for direct codegen of fsin/fcos.

llvm-svn: 42369
2007-09-26 21:12:10 +00:00
Gordon Henriksen c23b66c58b 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.

llvm-svn: 42367
2007-09-26 20:56:12 +00:00
Duncan Sands 0bcbceb647 Test the C front-end, not the C++ front-end.
llvm-svn: 42350
2007-09-26 07:28:20 +00:00
Duncan Sands 9b626f0ada Test that local variables are aligned as the user requested.
llvm-svn: 42338
2007-09-26 04:04:29 +00:00
Devang Patel 7bba386f72 Handle multiple induction variables.
This fixes PR714.

llvm-svn: 42309
2007-09-25 18:24:48 +00:00
Dan Gohman 31599685c7 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.

llvm-svn: 42308
2007-09-25 18:23:27 +00:00
Dale Johannesen 97d4bf2c41 Some tests for APFloat conversions.
llvm-svn: 42303
2007-09-25 17:50:55 +00:00
Evan Cheng 6cb71f7fe0 Forgot to check in the changes. Fix test case so it doesn't break with any scheduling changes.
llvm-svn: 42302
2007-09-25 17:47:38 +00:00
Devang Patel 87d7e8ebcb 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();                            

llvm-svn: 42299
2007-09-25 17:31:19 +00:00
Devang Patel 9e30e1a3be Do not promote null values because it may be unsafe to do so.
llvm-svn: 42270
2007-09-24 20:02:42 +00:00
Tanya Lattner 583e27d755 XFAIL for llvm-gcc4.0
llvm-svn: 42266
2007-09-24 17:14:53 +00:00
Dan Gohman 6002818999 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.

llvm-svn: 42264
2007-09-24 15:54:53 +00:00
Dan Gohman f818ccd463 Fix a typo in a comment.
llvm-svn: 42263
2007-09-24 15:50:11 +00:00
Dale Johannesen ae4bb05103 Implementation of +sse -sse2 has changed; add
-sse to preserve intent of this test.

llvm-svn: 42247
2007-09-23 14:58:14 +00:00
Devang Patel 361e52f39c Fix PR1692
llvm-svn: 42209
2007-09-21 21:18:19 +00:00
Chris Lattner af6912f980 gcroot testcase, patch by Eric Christopher.
llvm-svn: 42198
2007-09-21 17:48:39 +00:00
Rafael Espindola 4730c04904 Don't add a default STACK_ALIGN (use the generic ABI alignment)
Implement calls to functions with byval arguments on X86

llvm-svn: 42192
2007-09-21 15:50:22 +00:00
Duncan Sands 416b9f0410 Testcase for PR1678.
llvm-svn: 42171
2007-09-20 18:56:24 +00:00
Evan Cheng 723dab1005 Disable if-conversion for this test.
llvm-svn: 42170
2007-09-20 18:06:22 +00:00
Evan Cheng 77d4771405 -enable-arm-if-conversion is gone.
llvm-svn: 42169
2007-09-20 18:03:23 +00:00
Gordon Henriksen 1f982339e7 Incorporating review feedback for GC verifier patch.
llvm-svn: 42163
2007-09-20 16:47:41 +00:00
Dan Gohman 4dbc582a36 Fix several more entries in the x86 reload/remat folding tables.
llvm-svn: 42162
2007-09-20 14:17:21 +00:00
Nick Lewycky e7be16a053 Excuse me.
llvm-svn: 42158
2007-09-20 00:57:00 +00:00
Nick Lewycky eae7e7d00b Fix optimization. %x = sub %x, %y does not imply that %y is zero.
llvm-svn: 42157
2007-09-20 00:48:36 +00:00
Devang Patel 464276f831 Avoid unsafe promotion.
llvm-svn: 42149
2007-09-19 20:18:51 +00:00
Duncan Sands 4e426623f5 Testcase for PR1678.
llvm-svn: 42128
2007-09-19 07:43:17 +00:00
Evan Cheng e7ff9da64b Clean up.
llvm-svn: 42112
2007-09-18 22:56:31 +00:00
Evan Cheng e2e8f2d96b Fix a bogus splat xform:
shuffle <undef, undef, x, undef>, <undef, undef, undef, undef>, <2, 2, 2, 2>
!=
<undef, undef, x, undef>

llvm-svn: 42111
2007-09-18 21:54:37 +00:00
Gabor Greif 49122edc98 rename test, it is obviously misspelled
llvm-svn: 42108
2007-09-18 21:42:39 +00:00
Gordon Henriksen dc88c06732 Tests of the ocaml (and thus C) bindings for constants.
llvm-svn: 42101
2007-09-18 18:07:51 +00:00
Gordon Henriksen 37582f74cd 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.

llvm-svn: 42093
2007-09-18 12:49:39 +00:00
Gordon Henriksen 5c4d7b8052 (no commit message)
llvm-svn: 42090
2007-09-18 12:26:17 +00:00
Devang Patel fcda998ab2 Fix PR1657
llvm-svn: 42075
2007-09-18 01:54:42 +00:00
Bill Wendling 067f1d8e95 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.

llvm-svn: 42074
2007-09-18 01:47:22 +00:00
Gordon Henriksen a2f3e13cf4 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.

llvm-svn: 42051
2007-09-17 20:30:04 +00:00
Dan Gohman 2ac2652779 Instcombine x-((x/y)*y) into a remainder operator.
llvm-svn: 42035
2007-09-17 17:31:57 +00:00
Dan Gohman 863bdc332d Emit integer x<1 as x<=0, as comparisons with zero (now includeing
64-bit) can use test instead of cmp with an immediate.

llvm-svn: 42026
2007-09-17 14:49:27 +00:00
Dan Gohman 51d1929b9e Use "test reg,reg" in place of "cmp reg,0" for 64-bit operands. This was
previously only done for 32-bit and smaller operands.

llvm-svn: 42024
2007-09-17 14:35:24 +00:00
Chris Lattner dd76f2f4ab remove obsolete tests.
llvm-svn: 41984
2007-09-15 17:38:04 +00:00
Chris Lattner 6ad68c220a New testcase for PR1662. GCC trees are horrible :(
llvm-svn: 41979
2007-09-15 05:46:41 +00:00
Dan Gohman c519c38629 Add explicit triples to avoid default behavior that varies by host.
llvm-svn: 41959
2007-09-14 20:37:18 +00:00
Rafael Espindola 272f7304f0 Add support for functions with byval arguments on x86
llvm-svn: 41953
2007-09-14 15:48:13 +00:00
Evan Cheng d8317967aa Fixed a typo that's causing a missing kill marker.
llvm-svn: 41893
2007-09-12 23:02:04 +00:00
Evan Cheng c16847b157 Sometimes a MI can define a register as well as defining a super-register at the
same time. Do not mark the "smaller" def as dead.

llvm-svn: 41871
2007-09-11 22:34:47 +00:00
Anton Korobeynikov 9811eb3d07 Fix date :)
llvm-svn: 41870
2007-09-11 22:20:27 +00:00
Anton Korobeynikov 38f9e2a4b6 Testcase for recent pragma pack stuff
llvm-svn: 41869
2007-09-11 22:12:26 +00:00
Duncan Sands 94580c7522 Test that a call to a trampoline is turned into a call to
the underlying nested function.

llvm-svn: 41846
2007-09-11 15:07:50 +00:00
Chris Lattner 0678def8d3 Testcase for PR1634
llvm-svn: 41824
2007-09-11 00:39:43 +00:00
Chris Lattner 6cf04f4952 remove obsolete testcase
llvm-svn: 41820
2007-09-10 23:51:41 +00:00
Chris Lattner 52fe869374 Fix a buggy constant folding transformation when handling aliases.
llvm-svn: 41818
2007-09-10 23:42:42 +00:00
Chris Lattner dae70d4d36 Fix PR1645 by resolving forward alias references.
llvm-svn: 41815
2007-09-10 23:23:53 +00:00
Dale Johannesen 62a48cea56 Add missing llvm-dis.
llvm-svn: 41813
2007-09-10 22:47:59 +00:00
Chris Lattner 7a9935c31f this is not infinite recursion.
llvm-svn: 41806
2007-09-10 21:16:23 +00:00
Chris Lattner c75cbe6473 Prevent tailcallelim from breaking "recursive" calls to builtins.
llvm-svn: 41804
2007-09-10 20:58:55 +00:00
Devang Patel f8ab0a9acc Filter exit conditions which are not yet handled.
llvm-svn: 41800
2007-09-10 18:33:42 +00:00
Devang Patel c24099ac82 New test.
llvm-svn: 41799
2007-09-10 18:12:52 +00:00
Dale Johannesen 29e6ac4281 Implement misaligned FP loads and stores.
llvm-svn: 41786
2007-09-08 19:29:23 +00:00
Bill Wendling 9929bc403d Add missing index versions of instructions to the map.
llvm-svn: 41776
2007-09-07 22:01:02 +00:00
Dan Gohman a95cbb0007 Avoid storing and reloading zeros and other constants from stack slots
by flagging the associated instructions as being trivially rematerializable.

llvm-svn: 41775
2007-09-07 21:32:51 +00:00
Rafael Espindola 1de0c86717 Add support for having different alignment for objects on call frames.
The x86-64 ABI states that objects passed on the stack have
8 byte alignment. Implement that.

llvm-svn: 41768
2007-09-07 14:52:14 +00:00
Anton Korobeynikov 122bf4be7e Split eh.select / eh.typeid.for intrinsics into i32/i64 versions. This is needed, because they just "mark" register
liveins and we let frontend solve type issue, not lowering code :)

llvm-svn: 41763
2007-09-07 11:39:35 +00:00
Bill Wendling 5f912b9149 Test for PR1641.
llvm-svn: 41762
2007-09-07 08:30:09 +00:00
Chris Lattner 85a51e0060 Don't zap back to back volatile load/stores
llvm-svn: 41759
2007-09-07 05:33:03 +00:00
Anton Korobeynikov a07765b8f4 Proper handle case, when aliasee is external weak symbol referenced only by alias itself.
Also, fix a case, when target doesn't have weak symbols supported.

llvm-svn: 41746
2007-09-06 17:21:48 +00:00
Nick Lewycky b0b066eaaa When the two operands of an icmp are equal, there are five possible predicates
that would make the icmp true. Fixes PR1637.

llvm-svn: 41740
2007-09-06 01:10:22 +00:00
Evan Cheng 189df733ed Fix a bug in X86InstrInfo::convertToThreeAddress that caused it to codegen:
leal    (,%rcx,8), %rcx
It should be
leal    (,%rcx,8), %ecx

llvm-svn: 41735
2007-09-06 00:14:41 +00:00
Dale Johannesen 6480cc6f8c Change all floating constants that are not exactly
representable to use hex format.

llvm-svn: 41722
2007-09-05 17:50:36 +00:00
Duncan Sands 6820abe101 Testcases for PR1628.
llvm-svn: 41719
2007-09-05 11:53:04 +00:00
Bill Wendling b9bf812ba5 Add the 64-bit versions of the DS* Altivec instructions.
llvm-svn: 41717
2007-09-05 04:05:20 +00:00
Evan Cheng e0cb6bb8da Fix for PR1632. EHSELECTION always produces a i32 value.
llvm-svn: 41712
2007-09-04 20:39:26 +00:00
Evan Cheng 4dbd9f254a Fix for PR1613: added 64-bit rotate left PPC instructions and patterns.
llvm-svn: 41711
2007-09-04 20:20:29 +00:00
Evan Cheng ffac17a223 Fix a gcroot lowering bug.
llvm-svn: 41668
2007-09-01 02:00:51 +00:00
Rafael Espindola e636fc05d6 Initial support for calling functions with byval arguments on x86-64
llvm-svn: 41643
2007-08-31 15:06:30 +00:00
Evan Cheng 2e9d48aa0d Update test case to reflect Dale's change.
llvm-svn: 41639
2007-08-31 06:29:32 +00:00
Tanya Lattner ffb806cf0e Do not run on darwin.
llvm-svn: 41608
2007-08-30 16:07:20 +00:00
Evan Cheng ebb8540067 Added support to fold X86 load / store instructions. This allow rematerialized loads to be folded into their uses.
llvm-svn: 41599
2007-08-30 05:54:07 +00:00
Dan Gohman 312b70a970 Add explicit triples to avoid default behavior that varies by host.
llvm-svn: 41510
2007-08-27 20:54:48 +00:00
Duncan Sands dd94bde661 Remove this test as it is too hard to fix after the
latest EH changes, and in any case it is hard to
imagine how the original bug could be reintroduced.

llvm-svn: 41497
2007-08-27 17:08:14 +00:00
Duncan Sands 68b773df24 Fix this test: llvm-gcc-4.2 optimizes almost everything away,
resulting in zero matches, while llvm-gcc-4.1 manages to
remove one pointless selector changing the number of matches.

llvm-svn: 41494
2007-08-27 16:47:32 +00:00
Duncan Sands 90064ed445 Now that we don't output cleanups by default, the action
offset needs to be adjusted in this test.

llvm-svn: 41490
2007-08-27 16:30:05 +00:00
Dan Gohman 8dc0b93151 If the source and destination pointers in an llvm.memmove are known
to not alias each other, it can be translated as an llvm.memcpy.

llvm-svn: 41489
2007-08-27 16:26:13 +00:00
Rafael Espindola ff33241e16 call libc memcpy/memset if array size is bigger then threshold.
Coping 100MB array (after a warmup) shows that glibc 2.6.1 implementation on
x86-64 (core 2) is 30% faster (from 0.270917s to 0.188079s)

llvm-svn: 41479
2007-08-27 10:18:20 +00:00
Anton Korobeynikov 24fb6b2f8c Don't promote volatile loads/stores. This is needed (for example) to handle setjmp/longjmp properly.
This fixes PR1520.

llvm-svn: 41461
2007-08-26 21:43:30 +00:00
Devang Patel c1ef32ef3d Constant split values needs upper bound and lower bound check, just like any other split value.
llvm-svn: 41389
2007-08-25 01:09:14 +00:00
Chris Lattner 2ed652f11d Allow target constants to be illegal types. The target should
know how to handle them.  This fixes 
test/CodeGen/Generic/asm-large-immediate.ll

llvm-svn: 41388
2007-08-25 01:00:22 +00:00
Devang Patel 4e63e1f5b5 While calculating upper loop bound for first loop and lower loop bound for second loop, take care of edge cases.
llvm-svn: 41387
2007-08-25 00:56:38 +00:00
Duncan Sands a0f12c5493 Fix this testcase: there are two matches for
llvm.cttz.i64 because of the declaration of
the intrinsic.  Also, emit-llvm is automatic
and doesn't need to be specified.

llvm-svn: 41326
2007-08-23 17:22:50 +00:00
Andrew Lenharth 544fdd27fb update test to check that codegen works with llvm.used in llvm.metadata section
llvm-svn: 41289
2007-08-22 19:36:31 +00:00
Bill Wendling 9bbecaeb55 Testcase for llvm.c* intrinsic failures.
llvm-svn: 41268
2007-08-22 07:26:30 +00:00
Duncan Sands d9a21103dc Test handling of complex constants as lvalues.
llvm-svn: 41266
2007-08-22 05:58:22 +00:00
Devang Patel c2e2d15f45 Do not split loops rejected by processOneIterationLoop().
llvm-svn: 41194
2007-08-20 20:24:15 +00:00
Duncan Sands 28e82ccd09 Fix this test for gcc-4.2.
llvm-svn: 41187
2007-08-20 17:14:02 +00:00
Evan Cheng 595401079e Test dag xform: Fold C ? 0 : 1 to ~C or zext(~C) or trunc(~C)
llvm-svn: 41164
2007-08-18 06:11:57 +00:00
Devang Patel cec2ad95f4 Add loop index split tests.
llvm-svn: 41146
2007-08-17 22:02:15 +00:00
Evan Cheng 2c4ea1e411 New test. Make sure dynamic_stackalloc size is rounded up.
llvm-svn: 41135
2007-08-16 23:52:23 +00:00
Evan Cheng 1393d88cc6 Update test: dynamic_stackalloc size *must* be rounded to ensure stack ptr be left in a valid state.
llvm-svn: 41134
2007-08-16 23:51:28 +00:00
Rafael Espindola 4ba05408ac add byval test
llvm-svn: 41123
2007-08-16 13:09:02 +00:00
Reid Spencer 789eb6ce87 Add a test to ensure that obvious link messages are actually produced on
the standard error.

llvm-svn: 41116
2007-08-16 07:22:43 +00:00
Lauro Ramos Venancio a392cd2fde Implement FPOWI ExpandOp.
Fix PR1287.

llvm-svn: 41112
2007-08-15 22:13:27 +00:00
Evan Cheng 2047077272 Test case for PR1609.
llvm-svn: 41110
2007-08-15 20:30:10 +00:00
Dan Gohman 413a23d257 This test used "wc | grep ..."; convert it to use the count script.
llvm-svn: 41101
2007-08-15 13:55:47 +00:00