Commit Graph

1788 Commits

Author SHA1 Message Date
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
Dan Gohman
d595b5f1f0 Fix the folding of undef in several binary operators to recognize
undef in either the left or right operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38489 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 14:20:37 +00:00
Evan Cheng
af825c840e When a node value is only used by a CopyToReg, use the user's dest. This should not be restricted to nodes that produce only a single value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38485 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 07:08:32 +00:00
Evan Cheng
c63d391c9a Move DenseMapKeyInfo<SDOperand> from LegalizeDAG.cpp to SelectionDAGNodes.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38484 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 06:59:55 +00:00
Dan Gohman
d6fd1bc122 Preserve volatililty and alignment information when lowering or
simplifying loads and stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38473 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-09 22:18:38 +00:00
Dan Gohman
532dc2e1f2 Change getCopyToParts and getCopyFromParts to always use target-endian
register ordering, for both physical and virtual registers. Update the PPC
target lowering for calls to expect registers for the call result to
already be in target order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38471 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-09 20:59:04 +00:00
Dan Gohman
93f81e2822 Initialize the IndexedModeActions array with memset before
updating it with calls to setIndexedLoadAction/setIndexedStoreAction,
which only update a few bits at a time. This avoids ostensible
undefined behavior of operationg on values which may be
trap-representations, and as a practical matter fixes errors from
valgrind, which doesn't track uninitialized memory with bit
granularity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38468 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-09 20:49:44 +00:00
Chris Lattner
e094f54f4c Fix this warning:
DAGCombiner.cpp: In member function 'llvm::SDOperand<unnamed>::DAGCombiner::visitOR(llvm::SDNode*)':
DAGCombiner.cpp:1608: warning: passing negative value '-0x00000000000000001' for argument 1 to 'llvm::SDOperand llvm::SelectionDAG::getConstant(uint64_t, llvm::MVT::ValueType, bool)'

oiy.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38458 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-09 16:16:34 +00:00
Duncan Sands
f664e41b20 The exception handling intrinsics return values,
so must be lowered to a value, not nothing at all.
Subtle point: I made eh_selector return 0 and
eh_typeid_for return 1.  This means that only
cleanups (destructors) will be run as the exception
unwinds [if eh_typeid_for returned 0 then it would
be as if the first catch always matched, and the
corresponding handler would be run], which is
probably want you want in the CBE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37947 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 14:46:23 +00:00
Rafael Espindola
1aa7efbd2c Add the byval attribute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37940 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 10:57:03 +00:00
Duncan Sands
902919541f Remove propagateEHRegister in favour of a more limited
fix, that is adequate while PR1508 remains unresolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 09:18:59 +00:00
Duncan Sands
b4fd45e2fc Remove ExtractGlobalVariable - use StripPointerCasts
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37937 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 09:10:03 +00:00
Evan Cheng
86da6600ae Workaround of getCopyToRegs and getCopyFromRegs bugs for big-endian machines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37935 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 01:47:35 +00:00
Evan Cheng
991262834d Change CalculateHeights and CalculateDepths to be non-recursive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37934 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 01:37:28 +00:00
Dan Gohman
50b153335d Make the debug string for ISD::MERGE_VALUES consistent with the others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 20:15:43 +00:00
Dan Gohman
6183f78cf8 Add a parameter to getCopyToParts and getCopyFromParts to specify whether
endian swapping should be done, and update the code to use it. This fixes
some register ordering issues on big-endian systems, such as PowerPC,
introduced by the recent illegal by-val arguments changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37921 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 20:12:34 +00:00
Duncan Sands
cf26d7ccac Extend eh.selector to support both catches and filters.
Drop the eh.filter intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37875 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-04 20:52:51 +00:00
Dan Gohman
613e0d8008 Fix several over-aggressive folds for undef nodes in dagcombine, to
follow the rules for undef used in instcombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37851 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-03 14:03:57 +00:00
Dale Johannesen
849f214a4e Fix for PR 1505 (and 1489). Rewrite X87 register
model to include f32 variants.  Some factoring
improvments forthcoming.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37847 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-03 00:53:03 +00:00
Dan Gohman
27a70be55f Replace ExpandScalarFormalArgs and ExpandScalarCallArgs with the newly
refactored getCopyFromParts and getCopyToParts, which are more general.
This effectively adds support for lowering illegal by-val vector call
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37843 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-02 16:18:06 +00:00
Dan Gohman
23ff1826b9 Teach GetNegatedExpression to negate 0-B to B in UnsafeFPMath mode, and
visitFSUB to fold 0-B to -B in UnsafeFPMath mode. Also change visitFNEG
to use isNegatibleForFree/GetNegatedExpression instead of doing a subset
of the same thing manually.

This fixes test/CodeGen/X86/negative-sin.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37842 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-02 15:48:56 +00:00
Evan Cheng
c45453fa1d Only do FNEG xform when the vector type is a floating point type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 21:44:35 +00:00
David Greene
821262953a Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37816 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 21:42:03 +00:00
Evan Cheng
c908dcde45 Fix a vector FP constant CSE bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37814 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 21:36:04 +00:00
David Greene
a2a488594d Remove unnecessary attributions in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37799 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 03:42:23 +00:00
David Greene
cfacc8f5d2 Fix reference to cached end iterator invalidated by an erase operation.
Uncovered by _GLIBCXX_DEBUG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37795 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 02:49:11 +00:00
David Greene
a4ab2e8c72 Remove the "special tie breaker" because it resulted in inconsistent
ordering and thus violated the strict weak ordering requirement of
priority_queue.  Uncovered by _GLIBCXX_DEBUG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37794 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 02:48:09 +00:00
Dan Gohman
10a7aa6dea Fix an assertion failure in legalizing bitcast operators on targets where
vectors are split down to single elements as part of legalization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 00:09:08 +00:00
Dan Gohman
b6f5b00c3b Add new TargetLowering code to provide the final register type that an
illegal value type will be transformed to, for code that needs the
register type after all transformations instead of just after the first
transformation.

Factor out the code that uses this information to do copy-from-regs and
copy-to-regs for various purposes into separate functions so that they
are done consistently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 23:29:44 +00:00
Evan Cheng
e47c333a12 Partial fix for PR1502: If a EH register is needed in a successor of landing pad, add it as livein to all the blocks in the paths between the landing pad and the specified block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37763 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 18:45:32 +00:00
Dan Gohman
6595cb3000 Rename ("shrinkify") MVT::isExtendedValueType to MVT::isExtendedVT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37758 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 16:08:04 +00:00
Dan Gohman
8c8c5fcbd7 Use getVectorTypeBreakdown in FunctionLoweringInfo::CreateRegForValue
to compute the number and type of registers needed for vector values
instead of computing it manually. This fixes PR1529.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 14:34:07 +00:00
Dan Gohman
89b20c07e9 Make the comment for ScalarizeVectorOp mention that it is only for use
with single-element vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 14:06:22 +00:00
Dan Gohman
7f32156bb9 Generalize MVT::ValueType and associated functions to be able to represent
extended vector types. Remove the special SDNode opcodes used for pre-legalize
vector operations, and the special MVT::Vector type used with them. Adjust
lowering and legalize to work with the normal SDNode kinds instead, and to
use the normal MVT functions to work with vector types instead of using the
two special operands that the pre-legalize nodes held.

This allows pre-legalize and post-legalize DAGs, and the code that operates
on them, to be more consistent. Pre-legalize vector operators can be handled
more consistently with scalar operators. And, -view-dag-combine1-dags and
-view-legalize-dags now look prettier for vector code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37719 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 16:23:39 +00:00
Dan Gohman
ea859be53c Move ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits from
TargetLowering to SelectionDAG so that they have more convenient
access to the current DAG, in preparation for the ValueType routines
being changed from standalone functions to members of SelectionDAG for
the pre-legalize vector type changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37704 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 14:59:07 +00:00
Evan Cheng
0b2ce1fc19 std::set is really really terrible. Switch to SmallPtrSet to reduce compile time. For Duraid's example. The overall isel time is reduced from 0.6255 sec to 0.1876 sec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37701 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 01:35:51 +00:00
Dan Gohman
2d74a318de Tidy up ValueType names in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 14:48:26 +00:00
Dan Gohman
b9f1019696 Rename TargetLowering::getNumElements and friends to
TargetLowering::getNumRegisters and similar, to avoid confusion with
the actual number of elements for vector types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37687 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 14:42:22 +00:00
Evan Cheng
b13cdbd865 Xforms:
(add (select cc, 0, c), x) -> (select cc, x, (add, x, c))
(sub x, (select cc, 0, c)) -> (select cc, x, (sub, x, c))


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37685 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 07:39:16 +00:00
Dan Gohman
b5bec2b6f6 Pass a SelectionDAG into SDNode::dump everywhere it's used, in prepration
for needing the DAG node to print pre-legalize extended value types, and
to get better debug messages with target-specific nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19 14:13:56 +00:00
Chris Lattner
aeeccfc5b2 add isVarArg to CCState
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37640 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19 00:11:09 +00:00
Chris Lattner
e10e6f7a36 make ComputeTopDownOrdering significantly faster and use less stack space
by making it non-recursive


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37629 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-18 21:28:10 +00:00
Dan Gohman
7a0a4fc912 Make chain dependencies blue, in addition to being dashed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37626 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-18 15:30:16 +00:00
Tanya Lattner
24e5aada7d Codegen support (stripped out) for the annotate attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37608 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 22:26:58 +00:00
Chris Lattner
c2c28fc24c Fix CodeGen/X86/inline-asm-x-scalar.ll:test4, by retaining regclass info
for tied register constraints.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37601 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 19:11:01 +00:00
Duncan Sands
f40708223e Workaround for PR1508.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37597 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 19:04:19 +00:00
Dan Gohman
51eaa86758 Rename MVT::getVectorBaseType to MVT::getVectorElementType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37579 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-14 22:58:02 +00:00
Duncan Sands
ea632439d4 Only correctly lower exception handing intrinsics if exception handling is
turned on.  Likewise for scanning of invokes to mark landing pads.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37570 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-13 16:53:21 +00:00