Commit Graph

1835 Commits

Author SHA1 Message Date
Dan Gohman
e9c8fa095e Make DAGCombiner's global alias analysis query more precise in the case
where both pointers have non-zero offsets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41491 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 16:32:11 +00:00
Dan Gohman
5f43f92c69 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41489 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 16:26:13 +00:00
Duncan Sands
6590b0457c There is an impedance matching problem between LLVM and
gcc exception handling: if an exception unwinds through
an invoke, then execution must branch to the invoke's
unwind target.  We previously tried to enforce this by
appending a cleanup action to every selector, however
this does not always work correctly due to an optimization
in the C++ unwinding runtime: if only cleanups would be
run while unwinding an exception, then the program just
terminates without actually executing the cleanups, as
invoke semantics would require.  I was hoping this
wouldn't be a problem, but in fact it turns out to be the
cause of all the remaining failures in the LLVM testsuite
(these also fail with -enable-correct-eh-support, so turning
on -enable-eh didn't make things worse!).  Instead we need
to append a full-blown catch-all to the end of each
selector.  The correct way of doing this depends on the
personality function, i.e. it is language dependent, so
can only be done by gcc.  Thus this patch which generalizes
the eh.selector intrinsic so that it can handle all possible
kinds of action table entries (before it didn't accomodate
cleanups): now 0 indicates a cleanup, and filters have to be
specified using the number of type infos plus one rather than
the number of type infos.  Related gcc patches will cause
Ada to pass a cleanup (0) to force the selector to always
fire, while C++ will use a C++ catch-all (null).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41484 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 15:47:50 +00:00
Dale Johannesen
e6c1742914 Revise per review comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41409 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 01:18:27 +00:00
Dale Johannesen
87503a63d5 Add APFloat interface to ConstantFPSDNode. Change
over uses in DAGCombiner.  Fix interfaces to work
with APFloats.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41407 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 22:10:57 +00:00
Chris Lattner
09ec1b0583 Allow target constants to be illegal types. The target should
know how to handle them.  This fixes 
test/CodeGen/Generic/asm-large-immediate.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41388 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 01:00:22 +00:00
Chris Lattner
7df31dc89b Teach the dag scheduler to handle inline asm nodes with multi-value immediate operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41386 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 00:53:07 +00:00
Chris Lattner
48884cd80b rename isOperandValidForConstraint to LowerAsmOperandForConstraint,
changing the interface to allow for future changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41384 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 00:47:38 +00:00
Dale Johannesen
12595d7b16 Poison APFloat::operator==. Replace existing uses with bitwiseIsEqual.
This means backing out the preceding change to Constants.cpp, alas.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41378 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 22:09:56 +00:00
Dale Johannesen
8bb369b807 Use APFloat internally for ConstantFPSDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41372 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 20:59:15 +00:00
Anton Korobeynikov
2f597bd09e Perform correct codegen for eh_dwarf_cfa intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41316 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-23 07:21:06 +00:00
Dan Gohman
8d1bfad00b Minor cleanups to reduce some spurious differences between different
scheduler implementations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20 19:28:38 +00:00
Rafael Espindola
21485be444 Partial implementation of calling functions with byval arguments:
*) The needed information is propagated to the DAG
 *) The X86-64 backend detects it and aborts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41179 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20 15:18:24 +00:00
Evan Cheng
571c4788d5 Fold C ? 0 : 1 to ~C or zext(~C) or trunc(~C) depending the types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41163 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-18 05:57:05 +00:00
Evan Cheng
3e20bba5eb Avoid issue on 64-bit hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41143 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-17 18:02:22 +00:00
David Greene
fd273b6ed5 Fix GLIBCXX_DEBUG error of comparing two singular iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41139 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-17 15:13:55 +00:00
Evan Cheng
61bbbabe3d If dynamic_stackalloc alignment is > stack alignment, first issue an instruction to align the stack ptr before the decrement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41133 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-16 23:50:06 +00:00
Evan Cheng
4515779fa3 - If a dynamic_stackalloc alignment requirement is <= stack alignment, then the alignment argument is ignored.
- *Always* round up the size of the allocation to multiples of stack
alignment to ensure the stack ptr is never left in an invalid state after a dynamic_stackalloc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41132 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-16 23:46:29 +00:00
Lauro Ramos Venancio
c90f08936d Implement FPOWI ExpandOp.
Fix PR1287.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41112 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 22:13:27 +00:00
Dan Gohman
25ac7e8364 Fix EXTRACT_ELEMENT, EXTRACT_SUBVECTOR, and EXTRACT_VECTOR_ELT to
use an intptr ValueType instead of i32 for the index operand in
getCopyToParts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40987 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 14:59:38 +00:00
Rafael Espindola
594d37e21a propagate struct size and alignment of byval arguments to the DAG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40986 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 14:44:42 +00:00
Dale Johannesen
ab081c7195 Update per review comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40965 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09 17:27:48 +00:00
Dale Johannesen
5411a3937f long double 9 of N. This finishes up the X86-32 bits
(constants are still not handled).  Adds ConvertActions
to control fp-to-fp conversions (these are currently
defaulted for all other targets, so no changes there).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40958 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09 01:04:01 +00:00
Scott Michel
c1513d24ea If a target really needs to custom lower constants, it should be allowed
to do so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40955 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 23:23:31 +00:00
Chandler Carruth
6994040a95 This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40807 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:51:18 +00:00
Chris Lattner
b15e49597f don't redefine a parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40748 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:08:16 +00:00
Evan Cheng
33d5595d66 Do not emit copies for physical register output if it's not used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40722 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 05:29:38 +00:00
Scott Michel
335f4f7788 Style police: Expand the tabs to spaces!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40712 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 02:22:46 +00:00
Evan Cheng
8409747efa Instead of adding copyfromreg's to handle physical definitions. Now isel can
simply specify them as results and let scheduledag handle them. That
is, instead of
SDOperand Flag = DAG.getTargetNode(Opc, MVT::i32, MVT::Flag, ...)
SDOperand Result = DAG.getCopyFromReg(Chain, X86::EAX, MVT::i32, Flag)

Just write:
SDOperand Result = DAG.getTargetNode(Opc, MVT::i32, MVT::i32, ...)

And let scheduledag emit the move from X86::EAX to a virtual register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40710 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 00:28:15 +00:00
Lauro Ramos Venancio
f3c13c82e3 Expand unaligned loads/stores when the target doesn't support them. (PR1548)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40682 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 19:34:21 +00:00
Scott Michel
910b66d8d6 - Allow custom lowering for CTPOP, CTTZ, CTLZ.
- Fixed an existing unexpanded tab.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40605 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 21:00:31 +00:00
Dan Gohman
be444ed6db Fix a bug in getCopyFromParts turned up in the testcase for PR1132.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40598 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 19:09:17 +00:00
Duncan Sands
36397f5034 Support for trampolines, except for X86 codegen which is
still under discussion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40549 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 12:58:54 +00:00
Dan Gohman
559742c0ea Fix the alias analysis query in DAGCombiner to not add in two
offsets. The SrcValueOffset values are the real offsets from the
SrcValue base pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40534 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 16:14:06 +00:00
Christopher Lamb
e24f8f1ec9 Teach DAG scheduling how to properly emit subreg insert/extract machine instructions. PR1350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40520 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 08:12:07 +00:00
Christopher Lamb
557c3631d3 Add selection DAG nodes for subreg insert/extract. PR1350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40516 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 07:34:40 +00:00
Christopher Lamb
844228a631 Fix infinite recursion for when extract_vector_elt is legal. Unfortunately no public targets use this code-path, so no test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 03:33:13 +00:00
Dan Gohman
dc9b3d0bb5 Add const to CanBeFoldedBy, CheckAndMask, and CheckOrMask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40480 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24 23:00:27 +00:00
Dan Gohman
275769a77a Fix some uses of dyn_cast to be uses of cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40443 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-23 20:24:29 +00:00
Duncan Sands
70d0bd1624 As pointed out by g++-4.2, the original code didn't do
what it thought it was doing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40044 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 07:31:58 +00:00
Dan Gohman
48613b930a It's not necessary to do rounding for alloca operations when the requested
alignment is equal to the stack alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40004 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-18 16:29:46 +00:00
Dan Gohman
07a96765da Fix comments about vectors to use the current wording.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39921 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 14:29:03 +00:00
Nick Lewycky
6d4b711e7f Fix the build. Patch from Holger Schurig.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39856 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 15:11:14 +00:00
Anton Korobeynikov
2365f51ed0 Long live the exception handling!
This patch fills the last necessary bits to enable exceptions
handling in LLVM. Currently only on x86-32/linux.

In fact, this patch adds necessary intrinsics (and their lowering) which
represent really weird target-specific gcc builtins used inside unwinder.

After corresponding llvm-gcc patch will land (easy) exceptions should be
more or less workable. However, exceptions handling support should not be 
thought as 'finished': I expect many small and not so small glitches
everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39855 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 14:06:15 +00:00
Dan Gohman
a346615d11 Fix the comment for LegalizeOp to more accurately reflect what it does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39827 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 20:14:11 +00:00
Dan Gohman
05d92fe7c4 Don't call SimplifyVBinOp for non-vector operations, following earlier review
feedback. This theoretically makes the common (scalar) case more efficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39823 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 20:03:40 +00:00
Dale Johannesen
e7e7d0d7e3 Skeleton of post-RA scheduler; doesn't do anything yet.
Change name of -sched option and DEBUG_TYPE to
pre-RA-sched; adjust testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39816 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 17:13:54 +00:00
Dan Gohman
743d3a7548 Change the peep for EXTRACT_VECTOR_ELT of BUILD_PAIR to look for
the new CONCAT_VECTORS node type instead, as that's what legalize
uses now. And add a peep for EXTRACT_VECTOR_ELT of INSERT_VECTOR_ELT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38503 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 18:20:44 +00:00
Evan Cheng
5e2456c959 If the operand is marked M_OPTIONAL_DEF_OPERAND, then it's a def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38496 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 17:52:20 +00:00
Dan Gohman
70fb1aefd5 Fix a bug in the folding of binary operators to undef.
Thanks to Lauro for spotting this!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38491 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 15:19:29 +00:00