Commit Graph

5107 Commits

Author SHA1 Message Date
Chris Lattner 470ab00c76 A better fix for my previous patch, MOVZQI2PQIrr just requires SSE2.
llvm-svn: 49986
2008-04-20 05:52:46 +00:00
Chris Lattner a124f1e219 Not all x86-64 machines have sse3 apparently.
llvm-svn: 49985
2008-04-20 05:47:56 +00:00
Chris Lattner b839c05a05 rename *.llx -> *.ll, last batch.
llvm-svn: 49971
2008-04-19 22:32:52 +00:00
Chris Lattner 50fb77f829 rename *.llx -> *.ll
llvm-svn: 49970
2008-04-19 22:29:10 +00:00
Chris Lattner fe48fbc1f1 rename *.llx -> *.ll
llvm-svn: 49969
2008-04-19 22:26:29 +00:00
Chris Lattner bc26e1bb8a Implement PR2206.
llvm-svn: 49967
2008-04-19 22:17:26 +00:00
Chris Lattner 334d33cad1 refactor handling of symbolic constant folding, picking up
a few new cases( see Integer/a1.ll), but not anything that
would happen in practice.

llvm-svn: 49965
2008-04-19 21:58:19 +00:00
Evan Cheng 5102bd9359 64-bit atomic operations.
llvm-svn: 49949
2008-04-19 02:30:38 +00:00
Dan Gohman 41eb949aaf Teach llvm-as to accept function types with multiple return types.
llvm-svn: 49945
2008-04-19 00:24:39 +00:00
Evan Cheng 7e4a55bc58 Be more careful with insert_subreg and extract_subreg where either source or destination operand has already been coalesced with another register that's defined by a insert_subreg or extract_subreg.
llvm-svn: 49843
2008-04-17 07:58:04 +00:00
Owen Anderson f9ae76d89c Make GVN able to remove unnecessary calls to read-only functions again.
llvm-svn: 49842
2008-04-17 05:36:50 +00:00
Evan Cheng c8c3a899c0 Fix a sub-register indice propagation bug.
llvm-svn: 49832
2008-04-17 00:06:42 +00:00
Evan Cheng 147cb764b5 Don't forget about sub-register indices when rematting instructions.
llvm-svn: 49830
2008-04-16 23:44:44 +00:00
Evan Cheng 59aa126e48 After reading memory that's already freed.
llvm-svn: 49810
2008-04-16 20:24:25 +00:00
Evan Cheng 7b989d853e Really test what's intended.
llvm-svn: 49802
2008-04-16 18:21:55 +00:00
Evan Cheng e45b8f89c5 Rewrite LiveVariable liveness computation. The new implementation is much simplified. It eliminated the nasty recursive routines and removed the partial def / use bookkeeping. There is also potential for performance improvement by replacing the conservative handling of partial physical register definitions. The code is currently disabled until live interval analysis is taught of the name scheme.
This patch also fixed a couple of nasty corner cases.

llvm-svn: 49784
2008-04-16 09:46:40 +00:00
Owen Anderson 81f7584c4e XFAIL this test for the moment. The real solution is to prevent ADCE
from transforming loops and adding a separate loop pass for removing
loops with know trip counts.  Until that happens, ADCE is miscompiling this code.

llvm-svn: 49769
2008-04-16 04:25:42 +00:00
Dan Gohman d43d3beeb0 Add support for the form of the SSE41 extractps instruction that
puts its result in a 32-bit GPR.

llvm-svn: 49762
2008-04-16 02:32:24 +00:00
Dan Gohman 8c99ccaf96 Recreate the size SDNode instead of reusing the old one in the x86
memcpy lowering code; this ensures that the size node has the desired
result type. This fixes a regression from r49572 with @llvm.memcpy.i64
on x86-32.

llvm-svn: 49761
2008-04-16 01:32:32 +00:00
Dan Gohman 01a5d36d9d Add movd instructions to move from MMX registers
to 64-bit GPR registers on x86-64.

llvm-svn: 49757
2008-04-15 23:55:07 +00:00
Dale Johannesen 8fc8a272e0 Don't assume a tail call can't reference a byval
argument to the outer function, this isn't correct.

llvm-svn: 49731
2008-04-15 17:41:34 +00:00
Dan Gohman 4370f26750 Treat EntryToken nodes as "passive" so that they aren't added to the
ScheduleDAG; they don't correspond to any actual instructions so they
don't need to be scheduled.

This fixes a bug where the EntryToken was being scheduled multiple
times in some cases, though it ended up not causing any trouble because 
EntryToken doesn't expand into anything. With this fixed the schedulers
reliably schedule the expected number of units, so we can check this
with an assertion.

This requires a tweak to test/CodeGen/X86/loop-hoist.ll because it
ends up getting scheduled differently in a trivial way, though it was
enough to fool the prcontext+grep that the test does.

llvm-svn: 49701
2008-04-15 01:22:18 +00:00
Dan Gohman b37dab1360 Upgrade these tests for the current intrinsic prototypes.
llvm-svn: 49669
2008-04-14 18:19:18 +00:00
Dale Johannesen ea3aa5bf11 Remove -unwind-tables-optional everywhere, since
this is now the default.

llvm-svn: 49667
2008-04-14 17:56:54 +00:00
Owen Anderson b1e8bf2cad The functionality being tested was removed because it was horribly unsafe.
llvm-svn: 49610
2008-04-13 09:51:06 +00:00
Arnold Schwaighofer 634fc9a33a This patch corrects the handling of byval arguments for tailcall
optimized x86-64 (and x86) calls so that they work (... at least for
my test cases).

Should fix the following problems:

Problem 1: When i introduced the optimized handling of arguments for
tail called functions (using a sequence of copyto/copyfrom virtual
registers instead of always lowering to top of the stack) i did not
handle byval arguments correctly e.g they did not work at all :).

Problem 2: On x86-64 after the arguments of the tail called function
are moved to their registers (which include ESI/RSI etc), tail call
optimization performs byval lowering which causes xSI,xDI, xCX
registers to be overwritten. This is handled in this patch by moving
the arguments to virtual registers first and after the byval lowering
the arguments are moved from those virtual registers back to
RSI/RDI/RCX.

llvm-svn: 49584
2008-04-12 18:11:06 +00:00
Dan Gohman 544ab2c50b Drop ISD::MEMSET, ISD::MEMMOVE, and ISD::MEMCPY, which are not Legal
on any current target and aren't optimized in DAGCombiner. Instead
of using intermediate nodes, expand the operations, choosing between
simple loads/stores, target-specific code, and library calls,
immediately.

Previously, the code to emit optimized code for these operations
was only used at initial SelectionDAG construction time; now it is
used at all times. This fixes some cases where rep;movs was being
used for small copies where simple loads/stores would be better.

This also cleans up code that checks for alignments less than 4;
let the targets make that decision instead of doing it in
target-independent code. This allows x86 to use rep;movs in
low-alignment cases.

Also, this fixes a bug that resulted in the use of rep;stos for
memsets of 0 with non-constant memory size when the alignment was
at least 4. It's better to use the library in this case, which
can be significantly faster when the size is large.

This also preserves more SourceValue information when memory
intrinsics are lowered into simple loads/stores.

llvm-svn: 49572
2008-04-12 04:36:06 +00:00
Dan Gohman 8c7cf88f7e Fix a bug that prevented x86-64 from using rep.movsq for
8-byte-aligned data.

llvm-svn: 49571
2008-04-12 02:35:39 +00:00
Evan Cheng 33281864c1 If a PHI node has a single implicit_def source, replace it with an implicit_def instead of a copy.
llvm-svn: 49543
2008-04-11 17:54:45 +00:00
Owen Anderson 90bde997b3 Add testcase for PR2213.
llvm-svn: 49517
2008-04-11 05:13:32 +00:00
Evan Cheng b53d560150 New test.
llvm-svn: 49514
2008-04-10 23:49:09 +00:00
Dan Gohman 99b7b3f03b Teach InstCombine's ComputeMaskedBits to handle pointer expressions
in addition to integer expressions. Rewrite GetOrEnforceKnownAlignment
as a ComputeMaskedBits problem, moving all of its special alignment
knowledge to ComputeMaskedBits as low-zero-bits knowledge.

Also, teach ComputeMaskedBits a few basic things about Mul and PHI
instructions.

This improves ComputeMaskedBits-based simplifications in a few cases,
but more noticeably it significantly improves instcombine's alignment
detection for loads, stores, and memory intrinsics.

llvm-svn: 49492
2008-04-10 18:43:06 +00:00
Evan Cheng 16ea87d6ee A copy instruction may use a register multiple times on some targets. Change them all.
llvm-svn: 49491
2008-04-10 18:38:47 +00:00
Chris Lattner ad75302497 Fix the x86-64 side of PR2108 by adding a v2f64 version of
MOVZQI2PQIrr.  This would be better handled as a dag combine 
(with the goal of eliminating the bitconvert) but I don't know
how to do that safely.  Thoughts welcome.

llvm-svn: 49463
2008-04-10 05:13:43 +00:00
Evan Cheng 9d339849ee Teach branch folding pass about implicit_def instructions. Unfortunately we can't just eliminate them since register scavenger expects every register use to be defined. However, we can delete them when there are no intra-block uses. Carefully removing some implicit def's which enable more blocks to be optimized away.
llvm-svn: 49461
2008-04-10 02:32:10 +00:00
Evan Cheng c8eeb752a3 - More aggressively coalescing away copies whose source is defined by an implicit_def.
- Added insert_subreg coalescing support.

llvm-svn: 49448
2008-04-09 20:57:25 +00:00
Chris Lattner 802134fc02 Generalize getUnaryFloatFunction to handle any FP unary function, automatically
figuring out the suffix to use.  implement pow(2,x) -> exp2(x).

llvm-svn: 49437
2008-04-09 17:48:11 +00:00
Chris Lattner 091afc7714 remove capital letter from test name.
llvm-svn: 49436
2008-04-09 17:46:36 +00:00
Owen Anderson ef9a6fd5c2 Factor a bunch of functionality related to memcpy and memset transforms out of
GVN and into its own pass.

llvm-svn: 49419
2008-04-09 08:23:16 +00:00
Evan Cheng aa3b55f842 Missed a hasInterval check.
llvm-svn: 49415
2008-04-09 01:30:15 +00:00
Chris Lattner b859fb49ed many cleanups to the pow optimizer. Allow it to handle powf,
add support for  pow(x, 2.0) -> x*x.

llvm-svn: 49411
2008-04-09 00:07:45 +00:00
Duncan Sands 470ab1a04d Check that bodies and calls but not declarations
are marked nounwind when compiling without
-fexceptions.

llvm-svn: 49393
2008-04-08 19:31:52 +00:00
Dale Johannesen 5169fa17b5 Rename -disable-required-unwind-tables to -unwind-tables-optional.
llvm-svn: 49391
2008-04-08 18:10:08 +00:00
Gabor Greif 00fcdeddd3 merge r48768 from branches/ggreif/parallelized-test
llvm-svn: 49382
2008-04-08 15:22:41 +00:00
Dale Johannesen 399c0e63af Missed one.
llvm-svn: 49365
2008-04-08 00:14:59 +00:00
Dale Johannesen da298f9107 Add -disable-required-unwind-tables to tests
that need it (usually, grepping for some string
found in unwind info)

llvm-svn: 49364
2008-04-08 00:14:17 +00:00
Duncan Sands d6481955db Testcase for pr2169.
llvm-svn: 49344
2008-04-07 17:03:16 +00:00
Evan Cheng 7b93268305 Fix test.
llvm-svn: 49343
2008-04-07 17:02:18 +00:00
Chris Lattner 5bd2f736e6 fix this testcase to pass and remove a duplicate instance of itself.
llvm-svn: 49281
2008-04-06 21:39:17 +00:00
Torok Edwin 613d7afe64 Prefer to expand mask for xor to -1, so we have a chance to turn it into a not.
If it cannot be expanded, it will keep the old behaviour and try to shrink the constant.
Part of enhancement for PR2191.

llvm-svn: 49280
2008-04-06 21:23:02 +00:00