summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Turn (X^C1) == C2 into X == C1^C2 iff X&~C1 = 0 (and move a function)Chris Lattner2005-09-231-72/+86
| | | | | | | | | This happens all the time on PPC for bool values, e.g. eliminating a xori in inverted-bool-compares.ll. This should be added to the dag combiner as well. llvm-svn: 23403
* Fix a problem duraid encountered on itanium where this folding:Chris Lattner2005-09-091-2/+6
| | | | | | | select (x < y), 1, 0 -> (x < y) incorrectly: the setcc returns i1 but the select returned i32. Add the zero extend as needed. llvm-svn: 23301
* Fix a crash viewing dags that have target nodes in themChris Lattner2005-09-091-1/+2
| | | | llvm-svn: 23300
* Last round of 2-node folds from SD.cpp. Will move on to 3 node ops suchNate Begeman2005-09-091-2/+4
| | | | | | as setcc and select next. llvm-svn: 23295
* Move yet more folds over to the dag combiner from sd.cppNate Begeman2005-09-081-2/+9
| | | | llvm-svn: 23278
* Another round of dag combiner changes. This fixes some missing XOR foldsNate Begeman2005-09-071-4/+4
| | | | | | as well as fixing how we replace old values with new values. llvm-svn: 23260
* Fix a bug nate ran into with replacealluseswith. In the recursive cse case,Chris Lattner2005-09-071-15/+45
| | | | | | | | we were losing a node, causing an assertion to fail. Now we eagerly delete discovered CSE's, and provide an optional vector to keep track of these discovered equivalences. llvm-svn: 23255
* Fix a checking failure in gsChris Lattner2005-09-031-1/+1
| | | | llvm-svn: 23235
* Make sure to auto-cse nullary opsChris Lattner2005-09-021-3/+9
| | | | llvm-svn: 23224
* Fix some buggy logic where we would try to remove nodes with two operandsChris Lattner2005-09-021-34/+56
| | | | | | | | | | from the binary ops map, even if they had multiple results. This latent bug caused a few failures with the dag isel last night. To prevent stuff like this from happening in the future, add some really strict checking to make sure that the CSE maps always match up with reality! llvm-svn: 23221
* Add support for ANY_EXTEND and add a few minor folds for itChris Lattner2005-09-021-1/+11
| | | | llvm-svn: 23203
* Fix some code in the current node combining code, spotted when it was movedNate Begeman2005-09-011-11/+3
| | | | | | | | | | over to DAGCombiner.cpp 1. Don't assume that SetCC returns i1 when folding (xor (setcc) constant) 2. Don't duplicate code in folding AND with AssertZext that is handled by MaskedValueIsZero llvm-svn: 23196
* Fix VC++ precedence warningsJeff Cohen2005-08-311-2/+2
| | | | llvm-svn: 23169
* Sigh, not my day. Fix typo.Nate Begeman2005-08-311-1/+1
| | | | llvm-svn: 23166
* Fix a mistake in my previous patch pointed out by sabre; the AssertZextNate Begeman2005-08-311-2/+3
| | | | | | case in MaskedValueIsZero was wrong. llvm-svn: 23165
* Remove some unnecessary casts, and add the AssertZext case toNate Begeman2005-08-311-2/+3
| | | | | | MaskedValueIsZero. llvm-svn: 23164
* Allow physregs to occur in the dag with multiple types. Though I don't ↵Chris Lattner2005-08-301-12/+8
| | | | | | | | likethis, it is a requirement on PPC, which can have an f32 value in r3 at onepoint in a function and a f64 value in r3 at another point. :( This fixes compilation of mesa llvm-svn: 23161
* Remove a bogus piece of my AssertSext/AssertZext patch. oops.Nate Begeman2005-08-301-2/+0
| | | | llvm-svn: 23148
* Add support for AssertSext and AssertZext, folding other extensions withNate Begeman2005-08-301-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | them. This allows for elminination of redundant extends in the entry blocks of functions on PowerPC. Add support for i32 x i32 -> i64 multiplies, by recognizing when the inputs to ISD::MUL in ExpandOp are actually just extended i32 values and not real i64 values. this allows us to codegen int mulhs(int a, int b) { return ((long long)a * b) >> 32; } as: _mulhs: mulhw r3, r4, r3 blr instead of: _mulhs: mulhwu r2, r4, r3 srawi r5, r3, 31 mullw r5, r4, r5 add r2, r2, r5 srawi r4, r4, 31 mullw r3, r4, r3 add r3, r2, r3 blr with a similar improvement on x86. llvm-svn: 23147
* Add a new API for NateChris Lattner2005-08-291-0/+27
| | | | llvm-svn: 23131
* Fix a bug in ReplaceAllUsesWithChris Lattner2005-08-281-1/+1
| | | | llvm-svn: 23122
* Checking types here is not safe, because multiple types can map to the sameChris Lattner2005-08-261-3/+0
| | | | | | register class. llvm-svn: 23103
* Revampt ReplaceAllUsesWith to be more efficient and easier to use.Chris Lattner2005-08-261-5/+53
| | | | llvm-svn: 23087
* Change ConstantPoolSDNode to actually hold the Constant itself instead ofChris Lattner2005-08-261-12/+11
| | | | | | | | putting it into the constant pool. This allows the isel machinery to create constants that it will end up deciding are not needed, without them ending up in the resultant function constant pool. llvm-svn: 23081
* Fix a huge annoyance: SelectNodeTo took types before the opcode unlikeChris Lattner2005-08-261-19/+17
| | | | | | every other SD API. Fix it to take the opcode before the types. llvm-svn: 23079
* Fix a nasty bug from a previous patch of mineChris Lattner2005-08-261-1/+1
| | | | llvm-svn: 23069
* New fold for SELECT_CCNate Begeman2005-08-251-1/+19
| | | | llvm-svn: 23058
* Don't auto-cse nodes that return flagsChris Lattner2005-08-251-17/+38
| | | | llvm-svn: 23055
* simplify the code a bit using isOperationLegalChris Lattner2005-08-251-4/+3
| | | | llvm-svn: 23053
* ADd support for TargetConstantPool nodesChris Lattner2005-08-251-1/+14
| | | | llvm-svn: 23041
* add a new TargetFrameIndex nodeChris Lattner2005-08-251-1/+13
| | | | llvm-svn: 23035
* add a methodChris Lattner2005-08-241-0/+6
| | | | llvm-svn: 23027
* Add ReplaceAllUsesWith that can take a vector of replacement values.Chris Lattner2005-08-241-15/+90
| | | | | | Add some foldings to hopefully help the illegal setcc issue, and move some code around. llvm-svn: 23025
* teach selection dag mask tracking about the fact that select_cc operates likeChris Lattner2005-08-241-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | select. Also teach it that the bit count instructions can only set the low bits of the result, depending on the size of the input. This allows us to compile this: int %eq0(int %a) { %tmp.1 = seteq int %a, 0 ; <bool> [#uses=1] %tmp.2 = cast bool %tmp.1 to int ; <int> [#uses=1] ret int %tmp.2 } To this: _eq0: cntlzw r2, r3 srwi r3, r2, 5 blr instead of this: _eq0: cntlzw r2, r3 rlwinm r3, r2, 27, 31, 31 blr when setcc is marked illegal on ppc (which restores parity to non-illegal setcc). Thanks to Nate for pointing this out. llvm-svn: 23013
* Teach SelectionDAG how to simplify a few more setcc-equivalent select_ccNate Begeman2005-08-241-6/+21
| | | | | | nodes so that backends don't have to. llvm-svn: 22999
* Fix optimization of select_cc seteq X, 0, 1, 0 -> srl (ctlz X), log2 X sizeNate Begeman2005-08-241-3/+3
| | | | llvm-svn: 22995
* Teach the SelectionDAG how to transform select_cc eq, X, 0, 1, 0 intoNate Begeman2005-08-231-0/+17
| | | | | | | either seteq X, 0 or srl (ctlz X), size(X-1), depending on what's legal for the target. llvm-svn: 22978
* add anew methodChris Lattner2005-08-211-0/+10
| | | | llvm-svn: 22957
* add a methodChris Lattner2005-08-211-0/+9
| | | | llvm-svn: 22955
* add a methodChris Lattner2005-08-211-0/+9
| | | | llvm-svn: 22949
* Add support for TargetGlobalAddress nodesChris Lattner2005-08-191-1/+14
| | | | llvm-svn: 22938
* Fix a bug in previous commitChris Lattner2005-08-191-1/+2
| | | | llvm-svn: 22936
* Print physreg register nodes with target names (e.g. F1) instead of numbersChris Lattner2005-08-191-1/+5
| | | | llvm-svn: 22934
* Fix VC++ precedence warning.Jeff Cohen2005-08-191-1/+1
| | | | llvm-svn: 22902
* Add support for target DAG nodes that take 4 operands, such as PowerPC'sNate Begeman2005-08-181-0/+8
| | | | | | rlwinm. llvm-svn: 22856
* Fix printing of VTSDNodesChris Lattner2005-08-181-0/+3
| | | | llvm-svn: 22853
* Move the code dependency for MathExtras.h from SelectionDAGNodes.h.Jim Laskey2005-08-171-1/+21
| | | | | | Added some class dividers in SelectionDAG.cpp. llvm-svn: 22841
* Culling out use of unions for converting FP to bits and vice versa.Jim Laskey2005-08-171-14/+3
| | | | llvm-svn: 22838
* Fix a bug in RemoveDeadNodes where it would crash when its "optional"Chris Lattner2005-08-171-1/+77
| | | | | | | | argument is not specified. Implement ReplaceAllUsesWith. llvm-svn: 22834
* add a new TargetConstant nodeChris Lattner2005-08-171-1/+19
| | | | llvm-svn: 22813
OpenPOWER on IntegriCloud