Commit Graph

20635 Commits

Author SHA1 Message Date
Evan Cheng
0e0014d049 At end of LSR, replace uses of now constant (as result of SplitCriticalEdge) PHI node with the constant value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43533 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 23:45:15 +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
Dale Johannesen
c784208a73 Add missing SSE builtins: CVTPD2PI, CVTPS2PI,
CVTTPD2PI, CVTTPS2PI, CVTPI2PD, CVTPI2PS.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43523 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 22:15:38 +00:00
Evan Cheng
de1631bc85 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43511 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 20:11:21 +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
Duncan Sands
14db5efbf0 Fix for visibility warnings generated by gcc-4.2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43500 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 13:14:37 +00:00
Duncan Sands
01405f9284 Add support for expanding trunc stores. Consider
storing an i170 on a 32 bit machine.  This is first
promoted to a trunc-i170 store of an i256.  On a
little-endian machine this expands to a store of
an i128 and a trunc-i42 store of an i128.  The
trunc-i42 store is further expanded to a trunc-i42
store of an i64, then to a store of an i32 and a
trunc-i10 store of an i32.  At this point the operand
type is legal (i32) and expansion stops (legalization
of the trunc-i10 needs to be handled in LegalizeDAG.cpp).
On big-endian machines the high bits are stored first,
and some bit-fiddling is needed in order to generate
aligned stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43499 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 12:50:39 +00:00
Duncan Sands
ba3b1d10fd If a call to getTruncStore is for a normal store,
offload to getStore rather than trying to handle
both cases at once (the assertions for example
assume the store really is truncating).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43498 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 12:40:58 +00:00
Dale Johannesen
8d26e594f0 Add missing MMX PSUBQ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43488 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 01:18:38 +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
Dan Gohman
a8cc4d3d3c Don't bitcast from pointer-to-vector to pointer-to-array when
lowering load and store instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43468 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 20:34:35 +00:00
Dan Gohman
767cf7069e Use an array instead of a fixed-length std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43467 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 20:24:00 +00:00
Dan Gohman
7f21fd5b64 Do a real assert if there is an unhandled vector instruction instead
of just printing to cerr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43466 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 20:14:29 +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
Dan Gohman
9962054775 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43464 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 19:52:04 +00:00
Dan Gohman
9330c3af45 Update a comment to reflect the current code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43463 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 19:32:39 +00:00
Dan Gohman
8480bc5b5b Remove an unused function argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43462 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 19:31:25 +00:00
Dan Gohman
b66cf43ef4 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 19:26:14 +00:00
Dan Gohman
aa34331e78 Avoid calling ValidStride when not all uses are addresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43460 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 19:23:53 +00:00
Ted Kremenek
8308a48536 Fixed warning concerning implicit conversion from a NULL pointer
constant to an unsigned int.  We now just directly assign the literal 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43459 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 18:43:39 +00:00
Evan Cheng
e127a73154 Avoid doing something dumb like rewriting using a 64-bit iv in 32-bit mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43446 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 07:57:50 +00:00
Chris Lattner
dc4756bfda add a note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43444 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 06:19:48 +00:00
Chris Lattner
0569187653 I am not sure this is a good idea to be an option, but rename the option for
now.  It conflicts with clang's -pedantic flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43431 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 03:14:55 +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
Ted Kremenek
adc9b9c317 Fixed assertion in Deserializer::~Deserializer that checks for
pointers that were not backpatched (previously checked the wrong invariant).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 23:38:38 +00:00
Anton Korobeynikov
536c64b4d6 Add 'pedantic' mode to verifier rejecting syntactically valid, but 'bad' due to other reasons code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43424 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 22:50:32 +00:00
Ted Kremenek
5973ef40ca Updated backpatching logic during object deserialization to perform
eager backpatching instead of waithing until all objects have been
deserialized.  This allows us to reduce the memory footprint needed
for backpatching.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43422 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 21:17:59 +00:00
Duncan Sands
dc84650679 The guaranteed alignment of ptr+offset is only the minimum of
of offset and the alignment of ptr if these are both powers of
2.  While the ptr alignment is guaranteed to be a power of 2,
there is no reason to think that offset is.  For example, if
offset is 12 (the size of a long double on x86-32 linux) and
the alignment of ptr is 8, then the alignment of ptr+offset
will in general be 4, not 8.  Introduce a function MinAlign,
lifted from gcc, for computing the minimum guaranteed alignment.
I've tried to fix up everywhere under lib/CodeGen/SelectionDAG/.
I also changed some places that weren't wrong (because both values
were a power of 2), as a defensive change against people copying
and pasting the code.
Hopefully someone who cares about alignment will review the rest
of LLVM and fix up the remaining places.  Since I'm on x86 I'm
not very motivated to do this myself...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43421 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 12:59:45 +00:00
Evan Cheng
402b678373 New entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43420 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 04:01:09 +00:00
Evan Cheng
168a66b21e A number of LSR fixes:
- ChangeCompareStride only reuse stride that is larger than current stride. It
  will let the general reuse mechanism to try to reuse a smaller stride.
- Watch out for multiplication overflow in ChangeCompareStride.
- Replace std::set with SmallPtrSet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43408 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 23:08:19 +00:00
Ted Kremenek
1a43e5ffe1 Added serialization support for APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43405 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 21:50:10 +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
f1fc54f951 Fix a crash. Make sure TLI is not null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43384 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 17:24:46 +00:00
Anton Korobeynikov
8d9d74eaa8 Fix off-by-one stack offset computations (dwarf information) for callee-saved
registers in case, when FP pointer was eliminated. This should fixes misc. random
EH-related crahses, when stuff is compiled with -fomit-frame-pointer.
Thanks Duncan for nailing this bug!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43381 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 09:13:24 +00:00
Eric Christopher
3c999a270e clo/clz aren't supported on mips I. Keep them around for when we'll
want them later (mips32/64).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43380 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 04:00:13 +00:00
Owen Anderson
ef15029258 Make a comment better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43379 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 03:47:14 +00:00
Gordon Henriksen
55cbec317d More fleshing out of docs/Passes.html, plus some typo fixes and
improved wording in source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43377 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 03:03:51 +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
Hartmut Kaiser
081fdf238b Silenced a VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43374 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 23:49:14 +00:00
Ted Kremenek
3bd9dcc08f Updated backpatching during object deserialization to support "smart"
pointers that employ unused bits in a pointer to store extra data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43373 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 23:40:35 +00:00
Hartmut Kaiser
8df77a9e0f Clarified operator precedence.
Silenced VC++ warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43372 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 23:15:31 +00:00
Hartmut Kaiser
0fcf68a5e0 Disambiguated variable name to comply with VC++'s archaic variable scoping rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43369 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 22:57:48 +00:00
Evan Cheng
5f8ebaa5c0 Do not rewrite compare instruction using iv of a different stride if the new
stride may be rewritten using the stride of the compare instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43367 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 22:45:20 +00:00
Dale Johannesen
ca4571e79f Support non-POSIX hosts by removing use of strncasecmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43364 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 21:54:43 +00:00
Bill Wendling
da6efc5268 Changed XXX to FIXME, and added comment to the README file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 19:49:32 +00:00
Ted Kremenek
2423e03ca8 Added special treatment of serializing NULL pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43357 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 18:42:52 +00:00
Evan Cheng
2c8ca5c415 Remove code that's commented out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43356 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 18:38:24 +00:00