Commit Graph

22673 Commits

Author SHA1 Message Date
Duncan Sands
ddc016cc85 Initial libcall support for LegalizeTypes. This is
much simpler than in LegalizeDAG because calls are
not yet expanded into call sequences: that happens
after type legalization has finished.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49634 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 06:48:48 +00:00
Chris Lattner
75caee2419 add a new CallGraphNode::removeCallEdgeFor method, tidy some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49617 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 19:41:25 +00:00
Owen Anderson
386ea355e7 Replace calls of the form V1->setName(V2->getName()) with V1->takeName(V2),
which is significantly more efficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 19:15:17 +00:00
Duncan Sands
4a6da60787 LegalizeTypes can sometimes have deleted nodes
in its maps.  Add some sanity checks that catch
this kind of thing.  Hopefully these can be
removed one day (once all problems are fixed!)
but for the moment it seems wise to have them in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 16:04:03 +00:00
Nicolas Geoffray
c0cb28fd3a Add a divided flag for the first piece of an argument divided into mulitple parts. Fixes PR1643
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49611 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 13:40:22 +00:00
Chris Lattner
3b37448904 Fix some serious logic errors that broke the jit on darwin/x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49606 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 07:04:56 +00:00
Duncan Sands
89f6d88db3 Merge LLVMBuilder and FoldingBuilder, calling
the result IRBuilder.  Patch by Dominic Hamon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49604 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 06:22:09 +00:00
Chris Lattner
86941611c9 Gabor points out that reserveOperandSpace takes # of values,
not # of operands as an input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49599 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 00:14:42 +00:00
Anton Korobeynikov
78c80fdbdd Provide option for stack alignment override
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49593 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 22:12:22 +00:00
Arnold Schwaighofer
4b5324ad2c 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49584 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 18:11:06 +00:00
Duncan Sands
460a14e09c Factor some libcall code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49583 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 17:14:18 +00:00
Dan Gohman
707e018423 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 04:36:06 +00:00
Dan Gohman
6f836adafe Fix a bug that prevented x86-64 from using rep.movsq for
8-byte-aligned data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49571 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 02:35:39 +00:00
Nate Begeman
6795ebb663 80 col fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49569 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 00:47:57 +00:00
Nate Begeman
e956398cf1 Restore code to disable crash catcher on older OS X systems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49568 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 00:47:46 +00:00
Evan Cheng
97b8c40d09 Add debugging code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49566 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 00:22:01 +00:00
Chris Lattner
6098e4be94 Reenable JIT symbol table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 18:11:56 +00:00
Evan Cheng
f2b24ca2c7 Do not add empty live intervals to handled_. They should never be undone for backtracking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 17:55:47 +00:00
Evan Cheng
f870fbc554 If a PHI node has a single implicit_def source, replace it with an implicit_def instead of a copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49543 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 17:54:45 +00:00
Evan Cheng
4cce6b4c78 Use of implicit_def is not part of live interval. Create empty intervals for the uses when the live interval is being spilled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 17:53:36 +00:00
Gabor Greif
78256a199e detabify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 09:34:57 +00:00
Owen Anderson
8f46c78fcc Fix PR2213 by simultaneously making GVN more aggressive with the return values
of calls and less aggressive with non-readnone calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 05:11:49 +00:00
Evan Cheng
d2012d0c4b Remove implicit_def instructions that become dead as result of coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:48:35 +00:00
Evan Cheng
5d3600f576 Allow registers defined by implicit_def to be clobbered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49512 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:47:53 +00:00
Dan Gohman
c04575f494 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:02:38 +00:00
Owen Anderson
f062f10231 Fix for PR2190. Memdep's non-local caching was checking dirtied blocks in the
wrong order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49499 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 22:13:32 +00:00
Dan Gohman
3bd659ba20 Make several symbols static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 21:11:47 +00:00
Dan Gohman
eee962e1ce 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49492 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 18:43:06 +00:00
Evan Cheng
172b70c62a A copy instruction may use a register multiple times on some targets. Change them all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49491 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 18:38:47 +00:00
Evan Cheng
f0785153e5 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49469 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 08:03:14 +00:00
Chris Lattner
2189c17443 add a note, this is actually not too bad to implement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 05:54:50 +00:00
Chris Lattner
a825d75f1d move the x86-32 part of PR2108 here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 05:37:47 +00:00
Chris Lattner
db66750753 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49463 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 05:13:43 +00:00
Evan Cheng
80b09fe8bc 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 02:32:10 +00:00
Chris Lattner
0c1963099f Disable an xform we've had for a long time, pow(x,0.5) -> sqrt.
This is not safe for all inputs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 02:07:51 +00:00
Evan Cheng
7e073baedb - More aggressively coalescing away copies whose source is defined by an implicit_def.
- Added insert_subreg coalescing support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49448 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 20:57:25 +00:00
Dan Gohman
7d8143f0ef Make isVectorClearMaskLegal's operand list const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 20:09:42 +00:00
Dan Gohman
c2ffd4b1cb Add XMM1 as a second return value register for f32 and f64 on x86-64. This
is needed for the x86-64-ABI handling of structs that contain floating-point
members that are returned by value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49441 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 17:54:37 +00:00
Dan Gohman
719e64e8c1 Add DX as a second return value register for i16 on x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 17:53:38 +00:00
Chris Lattner
cc7f168c6c Generalize getUnaryFloatFunction to handle any FP unary function, automatically
figuring out the suffix to use.  implement pow(2,x) -> exp2(x).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49437 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 17:48:11 +00:00
Chris Lattner
8bb9a4f28f use the new ConstantFP::get method to make this work with
long double and simplify the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 17:17:35 +00:00
Devang Patel
d4e0af9f89 Be conservative if getresult operand is neither call nor invoke.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 15:58:24 +00:00
Owen Anderson
a723d1e48f Factor a bunch of functionality related to memcpy and memset transforms out of
GVN and into its own pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 08:23:16 +00:00
Owen Anderson
82a66291b0 Remove accidentally duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49418 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 07:55:01 +00:00
Chris Lattner
288e78fbe7 add a simplified accessor for creating an fp constant of a
particular value but variable type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49416 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 06:38:30 +00:00
Evan Cheng
f20d943bc6 Missed a hasInterval check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 01:30:15 +00:00
Chris Lattner
4592230265 add a version of ConstantFP::get that doesn't take a redundant Type* value,
start migrating code over to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 00:45:01 +00:00
Chris Lattner
77d00b0cea many cleanups to the pow optimizer. Allow it to handle powf,
add support for  pow(x, 2.0) -> x*x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49411 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 00:07:45 +00:00
Dale Johannesen
e8277dc7d6 Rename -disable-required-unwind-tables to unwind-tables-optional.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 18:07:49 +00:00
Duncan Sands
92432a8db1 Convenience method for setting the nounwind
attribute for a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 07:23:58 +00:00