Dale Johannesen
9150652b21
Constant fold int-to-long-double conversions;
...
use APFloat for int-to-float/double; use
round-to-nearest for these (implementation-defined,
seems to match gcc).
llvm-svn: 42484
2007-09-30 18:19:03 +00:00
Dale Johannesen
4230512f32
Change APFloat::convertFromInteger to take the incoming
...
bit width instead of number of words allocated, which
makes it actually work for int->APF conversions.
Adjust callers. Add const to one of the APInt constructors
to prevent surprising match when called with const
argument.
llvm-svn: 42210
2007-09-21 22:09:37 +00:00
Dale Johannesen
7d67e547b5
More long double fixes. x86_64 should build now.
...
llvm-svn: 42155
2007-09-19 23:55:34 +00:00
Devang Patel
00064e1bab
Do not hide APInt::dump() inside #ifndef NDEBUG.
...
llvm-svn: 42068
2007-09-17 22:24:00 +00:00
Devang Patel
77ae4d358f
This is not ideal but unbreaks build failure.
...
APInt::dump() is inside #ifndef NDEBUG, however SelectionDAG dump() routines are not.
llvm-svn: 42047
2007-09-17 20:03:03 +00:00
Dale Johannesen
98d3a08d8f
Remove the assumption that FP's are either float or
...
double from some of the many places in the optimizers
it appears, and do something reasonable with x86
long double.
Make APInt::dump() public, remove newline, use it to
dump ConstantSDNode's.
Allow APFloats in FoldingSet.
Expand X86 backend handling of long doubles (conversions
to/from int, mostly).
llvm-svn: 41967
2007-09-14 22:26:36 +00:00
Chris Lattner
7955bbd9fd
Fix build problems on Cygwin (PR1652), patch by Patrick Walton.
...
llvm-svn: 41923
2007-09-13 06:09:48 +00:00
Evan Cheng
bb6a574def
Yet another getTargetNode variant.
...
llvm-svn: 41898
2007-09-12 23:39:49 +00:00
Dale Johannesen
028084efe5
Revise previous patch per review comments.
...
Next round of x87 long double stuff.
Getting close now, basically works.
llvm-svn: 41875
2007-09-12 03:30:33 +00:00
Dale Johannesen
245dceb06d
Add APInt interfaces to APFloat (allows directly
...
access to bits). Use them in place of float and
double interfaces where appropriate.
First bits of x86 long double constants handling
(untested, probably does not work).
llvm-svn: 41858
2007-09-11 18:32:33 +00:00
Duncan Sands
86e0119822
Fold the adjust_trampoline intrinsic into
...
init_trampoline. There is now only one
trampoline intrinsic.
llvm-svn: 41841
2007-09-11 14:10:23 +00:00
Dale Johannesen
446b900192
Add mod, copysign, abs operations to APFloat.
...
Implement some constant folding in SelectionDAG and
DAGCombiner using APFloat. Remove double versions
of constructor and getValue from ConstantFPSDNode.
llvm-svn: 41664
2007-08-31 23:34:27 +00:00
Dale Johannesen
da7469f2b5
Revise per review of previous patch.
...
llvm-svn: 41645
2007-08-31 17:03:33 +00:00
Dale Johannesen
3cf889f75e
Enhance APFloat to retain bits of NaNs (fixes oggenc).
...
Use APFloat interfaces for more references, mostly
of ConstantFPSDNode.
llvm-svn: 41632
2007-08-31 04:03:46 +00:00
Dale Johannesen
d246b2ca5c
Change LegalFPImmediates to use APFloat.
...
Add APFloat interfaces to ConstantFP, SelectionDAG.
Fix integer bit in double->APFloat conversion.
Convert LegalizeDAG to use APFloat interface in
ConstantFPSDNode uses.
llvm-svn: 41587
2007-08-30 00:23:21 +00:00
Dale Johannesen
b6d2bec418
Revise per review comments.
...
llvm-svn: 41409
2007-08-26 01:18:27 +00:00
Dale Johannesen
2cfcf70f82
Add APFloat interface to ConstantFPSDNode. Change
...
over uses in DAGCombiner. Fix interfaces to work
with APFloats.
llvm-svn: 41407
2007-08-25 22:10:57 +00:00
Dale Johannesen
bdea32d812
Poison APFloat::operator==. Replace existing uses with bitwiseIsEqual.
...
This means backing out the preceding change to Constants.cpp, alas.
llvm-svn: 41378
2007-08-24 22:09:56 +00:00
Dale Johannesen
7891d8edf0
Use APFloat internally for ConstantFPSDNode.
...
llvm-svn: 41372
2007-08-24 20:59:15 +00:00
Evan Cheng
358c3d1dac
Do not emit copies for physical register output if it's not used.
...
llvm-svn: 40722
2007-08-02 05:29:38 +00:00
Duncan Sands
644f917358
Support for trampolines, except for X86 codegen which is
...
still under discussion.
llvm-svn: 40549
2007-07-27 12:58:54 +00:00
Christopher Lamb
a8fc0e527b
Add selection DAG nodes for subreg insert/extract. PR1350
...
llvm-svn: 40516
2007-07-26 07:34:40 +00:00
Dan Gohman
b6a8ae20c7
Fix some uses of dyn_cast to be uses of cast.
...
llvm-svn: 40443
2007-07-23 20:24:29 +00:00
Duncan Sands
85ec2af554
As pointed out by g++-4.2, the original code didn't do
...
what it thought it was doing.
llvm-svn: 40044
2007-07-19 07:31:58 +00:00
Anton Korobeynikov
383a324735
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.
llvm-svn: 39855
2007-07-14 14:06:15 +00:00
Dan Gohman
60d6f96da3
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.
llvm-svn: 38503
2007-07-10 18:20:44 +00:00
Dan Gohman
a282694acf
Make the debug string for ISD::MERGE_VALUES consistent with the others.
...
llvm-svn: 37922
2007-07-05 20:15:43 +00:00
Evan Cheng
9458e6a551
Fix a vector FP constant CSE bug.
...
llvm-svn: 37814
2007-06-29 21:36:04 +00:00
Dan Gohman
3b62d7265d
Rename ("shrinkify") MVT::isExtendedValueType to MVT::isExtendedVT.
...
llvm-svn: 37758
2007-06-27 16:08:04 +00:00
Dan Gohman
a866514528
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.
llvm-svn: 37719
2007-06-25 16:23:39 +00:00
Dan Gohman
309d3d51b3
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.
llvm-svn: 37704
2007-06-22 14:59:07 +00:00
Dan Gohman
a7644dd9b9
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.
llvm-svn: 37656
2007-06-19 14:13:56 +00:00
Dan Gohman
5c4413120f
Rename MVT::getVectorBaseType to MVT::getVectorElementType.
...
llvm-svn: 37579
2007-06-14 22:58:02 +00:00
Dan Gohman
26455c4ae0
Introduce new SelectionDAG node opcodes VEXTRACT_SUBVECTOR and
...
VCONCAT_VECTORS. Use these for CopyToReg and CopyFromReg legalizing in
the case that the full register is to be split into subvectors instead
of scalars. This replaces uses of VBIT_CONVERT to present values as
vector-of-vector types in order to make whole subvectors accessible via
BUILD_VECTOR and EXTRACT_VECTOR_ELT.
This is in preparation for adding extended ValueType values, where
having vector-of-vector types is undesirable.
llvm-svn: 37569
2007-06-13 15:12:02 +00:00
Dan Gohman
92a7f3a65e
Resolve implicit alignment before computing the FoldingSet information so
...
that the CSE map always contains explicit alignment information. This allows
more loads to be CSE'd when there is a mix of explicit-alignment loads and
implicit-alignment loads.
Also, in SelectionDAG::FindModifiedNodeSlot, add the operands to the
FoldingSetNodeID before the load/store information instead of after, so
that it matches what is done elsewhere.
llvm-svn: 37411
2007-06-04 15:49:41 +00:00
Dan Gohman
703e0f8608
Add explicit qualification for namespace MVT members.
...
llvm-svn: 37320
2007-05-24 14:33:05 +00:00
Chris Lattner
01a26c74ae
Be more careful about folding op(x, undef) when we have vector operands.
...
This fixes CodeGen/X86/2007-04-24-VectorCrash.ll
llvm-svn: 36413
2007-04-25 00:00:45 +00:00
Christopher Lamb
8af6d5896f
PR400 phase 2. Propagate attributed load/store information through DAGs.
...
llvm-svn: 36356
2007-04-22 23:15:30 +00:00
Lauro Ramos Venancio
4e91908f17
X86 TLS: Implement review feedback.
...
llvm-svn: 36318
2007-04-21 20:56:26 +00:00
Reid Spencer
0c1349e6bc
Revert Christopher Lamb's load/store alignment changes.
...
llvm-svn: 36309
2007-04-21 18:36:27 +00:00
Christopher Lamb
bff50208c8
add support for alignment attributes on load/store instructions
...
llvm-svn: 36301
2007-04-21 08:16:25 +00:00
Lauro Ramos Venancio
2518889872
Implement "general dynamic", "initial exec" and "local exec" TLS models for
...
X86 32 bits.
llvm-svn: 36283
2007-04-20 21:38:10 +00:00
Chris Lattner
a77cb3ce68
fold noop vbitconvert instructions
...
llvm-svn: 35943
2007-04-12 05:58:43 +00:00
Chris Lattner
18d6718e78
add some assertions
...
llvm-svn: 35800
2007-04-09 05:23:13 +00:00
Reid Spencer
a090ffb2ab
For PR1297:
...
Change getOperationName to return std::string instead of const char*
llvm-svn: 35545
2007-04-01 07:32:19 +00:00
Dale Johannesen
4bbd2eefba
Fix incorrect combination of different loads. Reenable zext-over-truncate
...
combination.
llvm-svn: 35517
2007-03-30 21:38:07 +00:00
Chris Lattner
47206667c0
fold away addc nodes when we know there cannot be a carry-out.
...
llvm-svn: 34913
2007-03-04 20:40:38 +00:00
Chris Lattner
362621c7ae
eliminate some ops if they have an undef RHS
...
llvm-svn: 34908
2007-03-04 20:01:46 +00:00
Chris Lattner
387f464121
fold trivial token factor nodes. This allows us to compile
...
test/CodeGen/X86/fp-stack-ret.ll into:
movl 4(%esp), %eax
fldl (%eax)
ret
instead of:
subl $12, %esp
movl 16(%esp), %eax
movsd (%eax), %xmm0
movsd %xmm0, (%esp)
fldl (%esp)
addl $12, %esp
ret
by eliminating a token factor that blocked a check.
llvm-svn: 34584
2007-02-25 08:24:27 +00:00
Jim Laskey
4b37a4c712
Selection and lowering for exception handling.
...
llvm-svn: 34481
2007-02-21 22:53:45 +00:00
Chris Lattner
9af2c86bc8
Introduce new UnarySDNode/BinarySDNode/TernarySDNode nodes, which coallocate
...
their operands with the node itself. This reduces malloc traffic for operand
lists. This reduces isel time on kc++ from 2.6164 to 2.5570s, about 2.3%.
llvm-svn: 33878
2007-02-04 08:35:21 +00:00
Chris Lattner
22639f3d90
eliminate the SDNode::setValueTypes method.
...
llvm-svn: 33876
2007-02-04 07:37:24 +00:00
Chris Lattner
f17b4222e2
eliminate a bunch of duplicate ctors and helper functions.
...
llvm-svn: 33875
2007-02-04 07:28:00 +00:00
Chris Lattner
edfc7e5fa2
move MorphNode to out of line and merge setNodeOperands into it. There is
...
no behavior or performance change here.
llvm-svn: 33869
2007-02-04 02:49:29 +00:00
Chris Lattner
3bf17b6fa5
simplify MorphNodeTo to take a VTList operand.
...
llvm-svn: 33868
2007-02-04 02:41:42 +00:00
Chris Lattner
486edfbc6f
eliminate some extraneous methods in SDNode
...
llvm-svn: 33867
2007-02-04 02:32:44 +00:00
Chris Lattner
20754cc579
Give each selectiondag node class a home for it's vtable and rtti info
...
llvm-svn: 33866
2007-02-04 02:23:32 +00:00
Chris Lattner
cba058ce51
Eliminate some std::sets. This speeds up isel of kimwitu by about 0.9%
...
llvm-svn: 33852
2007-02-04 00:24:41 +00:00
Chris Lattner
feec7137ce
Switch SelectionDAG::ReplaceAllUsesOfValueWith to use a SmallSetVector for
...
the users set (most nodes have 1 or 2 users). This speeds up the isel pass
3.2% on kimwitu.
llvm-svn: 33849
2007-02-04 00:14:31 +00:00
Chris Lattner
296a83cefb
Fit in 80 columns
...
llvm-svn: 33745
2007-02-01 04:55:59 +00:00
Nate Begeman
eda5997cc8
Finish off bug 680, allowing targets to custom lower frame and return
...
address nodes.
llvm-svn: 33636
2007-01-29 22:58:52 +00:00
Jim Laskey
f9e5445ed4
Make LABEL a builtin opcode.
...
llvm-svn: 33537
2007-01-26 14:34:52 +00:00
Bill Wendling
355fc5ad50
Removed more <iostream> includes
...
llvm-svn: 32321
2006-12-07 20:28:15 +00:00
Bill Wendling
22e978a736
Removing even more <iostream> includes.
...
llvm-svn: 32320
2006-12-07 20:04:42 +00:00
Jeff Cohen
cc08c83186
Unbreak VC++ build.
...
llvm-svn: 32113
2006-12-02 02:22:01 +00:00
Evan Cheng
f64da389f8
Fix an incorrectly inverted condition.
...
llvm-svn: 31773
2006-11-16 00:08:20 +00:00
Reid Spencer
2230144a75
Make an assert comment match the tested assertion.
...
llvm-svn: 31686
2006-11-11 20:07:59 +00:00
Evan Cheng
b15000736c
Rename ISD::MemOpAddrMode to ISD::MemIndexedMode
...
llvm-svn: 31595
2006-11-09 17:55:04 +00:00
Jim Laskey
61feeb90f9
Remove redundant <cmath>.
...
llvm-svn: 31561
2006-11-08 19:16:44 +00:00
Jeff Cohen
7d6f3db3e2
Unbreak VC++ build.
...
llvm-svn: 31464
2006-11-05 19:31:28 +00:00
Evan Cheng
1a1e23eff7
Added getIndexedStore.
...
llvm-svn: 31458
2006-11-05 09:30:09 +00:00
Evan Cheng
9456dd8b81
Fix comments.
...
llvm-svn: 31414
2006-11-03 07:31:32 +00:00
Evan Cheng
c176f038b9
Added isPredecessor.
...
llvm-svn: 31409
2006-11-03 03:05:24 +00:00
Chris Lattner
cd7b92251d
silence warning
...
llvm-svn: 31397
2006-11-03 01:28:29 +00:00
Reid Spencer
de46e48420
For PR786:
...
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.
llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Evan Cheng
415f365e5c
Print jumptable index.
...
llvm-svn: 31340
2006-11-01 04:48:30 +00:00
Evan Cheng
c3e695137d
Added a new SDNode type: BR_JT for jumptable branch.
...
llvm-svn: 31292
2006-10-30 07:59:36 +00:00
Evan Cheng
7ab6123c42
VLOAD is not the LoadSDNode opcode.
...
llvm-svn: 31276
2006-10-29 06:14:47 +00:00
Nick Lewycky
dc146a9fb9
Remove spurious case. EXTLOAD is not one of the node opcodes.
...
llvm-svn: 31275
2006-10-29 02:26:30 +00:00
Jim Laskey
eef273a16f
Load and stores have not been uniqued properly.
...
llvm-svn: 31261
2006-10-28 17:25:28 +00:00
Chris Lattner
b78eb6c8d1
Fix a serious bug that caused any x86 vector stuff to infinite loop
...
llvm-svn: 31254
2006-10-28 06:15:26 +00:00
Jim Laskey
bd0f088743
Clean up.
...
llvm-svn: 31243
2006-10-27 23:52:51 +00:00
Jim Laskey
f576b42bb2
Switch over from SelectionNodeCSEMap to FoldingSet.
...
llvm-svn: 31240
2006-10-27 23:46:08 +00:00
Evan Cheng
96d6bf50ae
getPreIndexedLoad -> getIndexedLoad.
...
llvm-svn: 31209
2006-10-26 21:53:40 +00:00
Chris Lattner
78fd0f83ff
Trivial patch to speed up legalizing common i64 constants.
...
llvm-svn: 31020
2006-10-17 21:47:13 +00:00
Evan Cheng
1839d76f69
Reflect MemOpAddrMode change; added a helper to create pre-indexed load.
...
llvm-svn: 31016
2006-10-17 21:14:32 +00:00
Jim Laskey
e7d2c24a7d
Make it simplier to dump DAGs while in DAGCombiner. Remove a nasty optimization.
...
llvm-svn: 31009
2006-10-17 19:33:52 +00:00
Chris Lattner
bd9acad805
When SimplifySetCC was moved to the DAGCombiner, it was never removed from
...
SelectionDAG and it has since bitrotted. Remove the copy from SelectionDAG.
Next, remove the constant folding piece of DAGCombiner::SimplifySetCC into
a new FoldSetCC method which can be used by getNode() and SimplifySetCC.
This fixes obscure bugs.
llvm-svn: 30952
2006-10-14 00:41:01 +00:00
Chris Lattner
45ffb1eb70
Fix a bug where we incorrectly turned '(X & 0) == 0' into '(X & 0) >> -1',
...
which is undefined. "0" isn't a power of 2.
llvm-svn: 30947
2006-10-13 22:46:18 +00:00
Evan Cheng
ab51cf2e78
Merge ISD::TRUNCSTORE to ISD::STORE. Switch to using StoreSDNode.
...
llvm-svn: 30945
2006-10-13 21:14:26 +00:00
Evan Cheng
a731cb674a
Add RemoveDeadNode to remove a dead node and its (potentially) dead operands.
...
llvm-svn: 30916
2006-10-12 20:34:05 +00:00
Evan Cheng
d35734bd1f
Naming consistency.
...
llvm-svn: 30878
2006-10-11 07:10:22 +00:00
Andrew Lenharth
a6bbf33cbf
Jimptables working again on alpha.
...
As a bonus, use the GOT node instead of the AlphaISD::GOT for internal stuff.
llvm-svn: 30873
2006-10-11 04:29:42 +00:00
Evan Cheng
2da4671e05
FindModifiedNodeSlot needs to add LoadSDNode ivars to create proper SelectionDAGCSEMap ID.
...
llvm-svn: 30866
2006-10-11 01:47:58 +00:00
Evan Cheng
fe858538c0
SDNode::dump should also print out extension type and VT.
...
llvm-svn: 30860
2006-10-10 20:05:10 +00:00
Evan Cheng
e71fe34d75
Reflects ISD::LOAD / ISD::LOADX / LoadSDNode changes.
...
llvm-svn: 30844
2006-10-09 20:57:25 +00:00
Evan Cheng
af309d29b1
Add getStore() helper function to create ISD::STORE nodes.
...
llvm-svn: 30758
2006-10-05 22:57:11 +00:00
Evan Cheng
5d9fd977d3
Combine ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD into ISD::LOADX. Add an
...
extra operand to LOADX to specify the exact value extension type.
llvm-svn: 30714
2006-10-04 00:56:09 +00:00
Andrew Lenharth
c19ef92403
Comments on JumpTableness
...
llvm-svn: 30615
2006-09-26 20:02:30 +00:00
Chris Lattner
5a42ebcff3
Fold extract_element(cst) to cst
...
llvm-svn: 30478
2006-09-19 05:02:39 +00:00
Chris Lattner
4c059f4962
Minor speedup for legalize by avoiding some malloc traffic
...
llvm-svn: 30477
2006-09-19 04:51:23 +00:00
Evan Cheng
45fe3bc72c
Added support for machine specific constantpool values. These are useful for
...
representing expressions that can only be resolved at link time, etc.
llvm-svn: 30278
2006-09-12 21:00:35 +00:00
Chris Lattner
f0359b343a
Implement the fpowi now by lowering to a libcall
...
llvm-svn: 30225
2006-09-09 06:03:30 +00:00
Evan Cheng
e5570a4c3f
Move isCommutativeBinOp from SelectionDAG.cpp and DAGCombiner.cpp out. Make it a static method of SelectionDAG.
...
llvm-svn: 29951
2006-08-29 06:42:35 +00:00
Evan Cheng
849f4bf8dd
Eliminate SelectNodeTo() and getTargetNode() variants which take more than
...
3 SDOperand operands. They are replaced by versions which take an array
of SDOperand and the number of operands.
llvm-svn: 29905
2006-08-27 08:08:54 +00:00
Evan Cheng
34b70eea5c
SelectNodeTo now returns a SDNode*.
...
llvm-svn: 29901
2006-08-26 08:00:10 +00:00
Chris Lattner
65879caf07
minor changes.
...
llvm-svn: 29740
2006-08-16 22:57:46 +00:00
Chris Lattner
a4f3625c23
Use the appropriate typedef
...
llvm-svn: 29730
2006-08-16 20:59:32 +00:00
Chris Lattner
a5a3eafbd0
Start using SDVTList more consistently
...
llvm-svn: 29711
2006-08-15 19:11:05 +00:00
Chris Lattner
f98411a220
add a new SDVTList type and new SelectionDAG::getVTList methods to streamline
...
the creation of canonical VTLists.
llvm-svn: 29709
2006-08-15 17:46:01 +00:00
Chris Lattner
3bf4be453f
Add a new getNode() method that takes a pointer to an already-intern'd list
...
of value-type nodes. This avoids having to do mallocs for std::vectors of
valuetypes when a node returns more than one type.
llvm-svn: 29685
2006-08-14 23:31:51 +00:00
Chris Lattner
e93a39f2d7
remove SelectionDAG::InsertISelMapEntry, it is dead
...
llvm-svn: 29677
2006-08-14 22:24:39 +00:00
Chris Lattner
63268f0672
Add code to resize the CSEMap hash table. This doesn't speedup codegen of
...
kimwitu, but seems like a good idea from a "avoid performance cliffs" standpoint :)
llvm-svn: 29675
2006-08-14 22:19:25 +00:00
Chris Lattner
8e37283d8b
Add the actual constant to the hash for ConstantPool nodes. Thanks to
...
Rafael Espindola for pointing this out.
llvm-svn: 29669
2006-08-14 20:12:44 +00:00
Chris Lattner
0c2e5412bb
Remove 8 more std::map's.
...
llvm-svn: 29631
2006-08-11 21:55:30 +00:00
Chris Lattner
3f16b201e2
Move the BBNodes, GlobalValues, TargetGlobalValues, Constants, TargetConstants,
...
RegNodes, and ValueNodes maps into the CSEMap.
llvm-svn: 29626
2006-08-11 21:01:22 +00:00
Chris Lattner
fcb16470ec
eliminate the NullaryOps map, use CSEMap instead.
...
llvm-svn: 29621
2006-08-11 18:38:11 +00:00
Chris Lattner
a2f4086828
Change one ReplaceAllUsesWith method to take an array of operands to replace
...
instead of a vector of operands.
llvm-svn: 29616
2006-08-11 17:46:28 +00:00
Chris Lattner
c24a1d3093
Start eliminating temporary vectors used to create DAG nodes. Instead, pass
...
in the start of an array and a count of operands where applicable. In many
cases, the number of operands is known, so this static array can be allocated
on the stack, avoiding the heap. In many other cases, a SmallVector can be
used, which has the same benefit in the common cases.
I updated a lot of code calling getNode that takes a vector, but ran out of
time. The rest of the code should be updated, and these methods should be
removed.
We should also do the same thing to eliminate the methods that take a
vector of MVT::ValueTypes.
It would be extra nice to convert the dagiselemitter to avoid creating vectors
for operands when calling getTargetNode.
llvm-svn: 29566
2006-08-08 02:23:42 +00:00
Chris Lattner
97af9d5d3a
Eliminate some malloc traffic by allocating vectors on the stack. Change some
...
method that took std::vector<SDOperand> to take a pointer to a first operand
and #operands.
This speeds up isel on kc++ by about 3%.
llvm-svn: 29561
2006-08-08 01:09:31 +00:00
Chris Lattner
1ee75ce65d
Revamp the "CSEMap" datastructure used in the SelectionDAG class. This
...
eliminates a bunch of std::map's in the SelectionDAG, replacing them with a
home-grown hashtable.
This is still a work in progress: not all the maps have been moved over and the
hashtable never resizes. That said, this still speeds up llc 20% on kimwitu++
with -fast -regalloc=local using a release build.
llvm-svn: 29550
2006-08-07 23:03:03 +00:00
Evan Cheng
445b91a041
Clear TopOrder before assigning topological order. Some clean ups.
...
llvm-svn: 29546
2006-08-07 22:13:29 +00:00
Chris Lattner
8927c875bb
Make SelectionDAG::RemoveDeadNodes iterative instead of recursive, which
...
also make it simpler.
llvm-svn: 29524
2006-08-04 17:45:20 +00:00
Evan Cheng
bba1ebda32
- Change AssignTopologicalOrder to return vector of SDNode* by reference.
...
- Tweak implementation to avoid using std::map.
llvm-svn: 29479
2006-08-02 22:00:34 +00:00
Evan Cheng
9631a60020
Added AssignTopologicalOrder() to assign each node an unique id based on their topological order.
...
llvm-svn: 29431
2006-08-01 08:20:41 +00:00
Evan Cheng
b572401bea
Remove InFlightSet hack. No longer needed.
...
llvm-svn: 29373
2006-07-28 00:47:19 +00:00
Evan Cheng
acb606ff33
AssignNodeIds should return unsigned.
...
llvm-svn: 29343
2006-07-27 07:36:47 +00:00
Evan Cheng
29eefc164c
AssignNodeIds assign each node in the DAG an unique id.
...
llvm-svn: 29337
2006-07-27 06:39:06 +00:00
Chris Lattner
c0973edc69
Add an out-of-line virtual method for the sdnode class to give it a home.
...
llvm-svn: 29192
2006-07-19 00:00:37 +00:00
Evan Cheng
d19938834b
Ugly hack! Add helper functions InsertInFlightSetEntry and
...
RemoveInFlightSetEntry. They are used in place of direct set operators to
reduce instruction selection function stack size.
llvm-svn: 28987
2006-06-29 23:57:05 +00:00
Chris Lattner
710b3d5ea1
Fix CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll
...
llvm-svn: 28965
2006-06-28 18:29:47 +00:00
Chris Lattner
aaa23d953f
Add a new ISD::CALL node, make the default impl of TargetLowering::LowerCallTo
...
produce it.
llvm-svn: 28338
2006-05-16 22:53:20 +00:00
Chris Lattner
da076e41ab
remove dead vars
...
llvm-svn: 28254
2006-05-12 18:04:28 +00:00
Chris Lattner
8c02c3f41a
Compile:
...
%tmp152 = setgt uint %tmp144, %tmp149 ; <bool> [#uses=1]
%tmp159 = setlt uint %tmp144, %tmp149 ; <bool> [#uses=1]
%bothcond2 = or bool %tmp152, %tmp159 ; <bool> [#uses=1]
To setne, not setune, which causes an assertion fault.
llvm-svn: 28244
2006-05-12 17:03:46 +00:00
Chris Lattner
78da6792e7
Fold shifts with undef operands.
...
llvm-svn: 28167
2006-05-08 17:29:49 +00:00
Chris Lattner
751817c54f
constant fold sign_extend_inreg
...
llvm-svn: 28151
2006-05-06 23:05:41 +00:00
Chris Lattner
393d96a56c
Fix Regression/CodeGen/Generic/2006-04-26-SetCCAnd.ll and
...
PR748.
llvm-svn: 27987
2006-04-27 05:01:07 +00:00
Nate Begeman
4ca2ea5b43
JumpTable support! What this represents is working asm and jit support for
...
x86 and ppc for 100% dense switch statements when relocations are non-PIC.
This support will be extended and enhanced in the coming days to support
PIC, and less dense forms of jump tables.
llvm-svn: 27947
2006-04-22 18:53:45 +00:00
Chris Lattner
bc1b262725
Implement folding of a bunch of binops with undef
...
llvm-svn: 27863
2006-04-20 05:39:12 +00:00
Chris Lattner
7e7ad593cc
Make these predicates return true for bit_convert(buildvector)'s as well as
...
buildvectors.
llvm-svn: 27723
2006-04-15 23:38:00 +00:00
Chris Lattner
d3b504ae10
Implement support for the formal_arguments node. To get this, targets shouldcustom legalize it and remove their XXXTargetLowering::LowerArguments overload
...
llvm-svn: 27604
2006-04-12 16:20:43 +00:00
Chris Lattner
417b96b6dd
Don't memoize vloads in the load map! Don't memoize them anywhere here, let
...
getNode do it. This fixes CodeGen/Generic/2006-04-11-vecload.ll
llvm-svn: 27602
2006-04-12 03:25:41 +00:00
Chris Lattner
02274a5265
Add code generator support for VSELECT
...
llvm-svn: 27542
2006-04-08 22:22:57 +00:00
Chris Lattner
a9e77d14c7
Constant fold bitconvert(undef)
...
llvm-svn: 27391
2006-04-04 01:02:22 +00:00
Chris Lattner
1c22728787
These entries already exist
...
llvm-svn: 27340
2006-04-02 02:51:27 +00:00
Chris Lattner
1985e1cbb8
Add some missing node names
...
llvm-svn: 27339
2006-04-02 02:41:18 +00:00
Chris Lattner
5fe1f54c17
Significantly improve handling of vectors that are live across basic blocks,
...
handling cases where the vector elements need promotion, expansion, and when
the vector type itself needs to be decimated.
llvm-svn: 27278
2006-03-31 02:06:56 +00:00
Chris Lattner
8d57da2ffc
new node
...
llvm-svn: 27231
2006-03-28 19:54:42 +00:00
Chris Lattner
ffec47ebff
Add an assertion
...
llvm-svn: 27228
2006-03-28 19:04:49 +00:00
Chris Lattner
e55d171ccd
Tblgen doesn't like multiple SDNode<> definitions that map to the sameenum value. Split them into separate enums.
...
llvm-svn: 27201
2006-03-28 00:40:33 +00:00