summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't remove two operand, two result nodes from the binary ops map. TheseChris Lattner2005-12-011-36/+39
| | | | | | | | should come from the arbitrary ops map. This fixes Regression/CodeGen/PowerPC/2005-12-01-Crash.ll llvm-svn: 24571
* This is a bugfix for SelectNodeTo. In certain situations, we could beChris Lattner2005-12-011-0/+110
| | | | | | | | | | selecting a node and use a mix of getTargetNode() and SelectNodeTo. Because SelectNodeTo didn't check the CSE maps for a preexisting node and didn't insert its result into the CSE maps, we would sometimes miss a CSE opportunity. This is extremely rare, but worth fixing for completeness. llvm-svn: 24565
* Make SelectNodeTo return NChris Lattner2005-11-301-35/+49
| | | | llvm-svn: 24548
* CALLSEQ_START/END nodes don't get memoized, do not add them in whenChris Lattner2005-11-301-0/+4
| | | | | | replaceAllUses'ing. llvm-svn: 24539
* Fixed a bug introduced by my last commit: TargetGlobalValues should key onEvan Cheng2005-11-301-7/+13
| | | | | | GlobalValue * and index pair. Update getGlobalAddress() for symmetry. llvm-svn: 24524
* Added an index field to GlobalAddressSDNode so it can represent X+12, etc.Evan Cheng2005-11-301-2/+17
| | | | llvm-svn: 24523
* Add support for a new STRING and LOCATION node for line number support, patchChris Lattner2005-11-291-0/+16
| | | | | | contributed by Daniel Berlin, with a few cleanups here and there by me. llvm-svn: 24515
* Check in code to scalarize arbitrarily wide packed types for some simpleNate Begeman2005-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vector operations (load, add, sub, mul). This allows us to codegen: void %foo(<4 x float> * %a) { entry: %tmp1 = load <4 x float> * %a; %tmp2 = add <4 x float> %tmp1, %tmp1 store <4 x float> %tmp2, <4 x float> *%a ret void } on ppc as: _foo: lfs f0, 12(r3) lfs f1, 8(r3) lfs f2, 4(r3) lfs f3, 0(r3) fadds f0, f0, f0 fadds f1, f1, f1 fadds f2, f2, f2 fadds f3, f3, f3 stfs f0, 12(r3) stfs f1, 8(r3) stfs f2, 4(r3) stfs f3, 0(r3) blr llvm-svn: 24484
* Add some method variants, patch by Evan ChengChris Lattner2005-11-191-15/+41
| | | | llvm-svn: 24418
* Teach LLVM how to scalarize packed types. Currently, this only works onNate Begeman2005-11-191-0/+21
| | | | | | | | | | | | | | | | | | | | | | | packed types with an element count of 1, although more generic support is coming. This allows LLVM to turn the following code: void %foo(<1 x float> * %a) { entry: %tmp1 = load <1 x float> * %a; %tmp2 = add <1 x float> %tmp1, %tmp1 store <1 x float> %tmp2, <1 x float> *%a ret void } Into: _foo: lfs f0, 0(r3) fadds f0, f0, f0 stfs f0, 0(r3) blr llvm-svn: 24416
* continued readcyclecounter supportAndrew Lenharth2005-11-111-0/+1
| | | | llvm-svn: 24300
* Switch the allnodes list from a vector of pointers to an ilist of nodes.This ↵Chris Lattner2005-11-091-28/+20
| | | | | | | | eliminates the vector, allows constant time removal of a node froma graph, and makes iteration over the all nodes list stable when adding nodes to the graph. llvm-svn: 24263
* Change the ValueList array for each node to be shared instead of ↵Chris Lattner2005-11-081-5/+48
| | | | | | individuallyallocated. Further, in the common case where a node has a single value, justreference an element from a small array. This is a small compile-time win. llvm-svn: 24251
* Switch the operandlist/valuelist from being vectors to being just an ↵Chris Lattner2005-11-081-23/+33
| | | | | | | | | array.This saves 12 bytes from SDNode, but doesn't speed things up substantially (our graphs apparently already fit within the cache on my g5). In any case this reduces memory usage. llvm-svn: 24249
* Clean up RemoveDeadNodes significantly, by eliminating the need for a temporaryChris Lattner2005-11-081-32/+34
| | | | | | | | set and eliminating the need to iterate whenever something is removed (which can be really slow in some cases). Thx to Jim for pointing out something silly I was getting stuck on. :) llvm-svn: 24241
* add TargetExternalSymbolAndrew Lenharth2005-10-231-1/+13
| | | | llvm-svn: 23886
* Move some Legalize functionality over to the DAGCombiner where it belongs.Nate Begeman2005-10-131-131/+0
| | | | | | Kill some dead code. llvm-svn: 23706
* This function is now deadChris Lattner2005-10-101-110/+0
| | | | llvm-svn: 23684
* Enable Nate's excellent DAG combiner work by default. This allows theChris Lattner2005-10-101-542/+14
| | | | | | removal of a bunch of ad-hoc and crufty code from SelectionDAG.cpp. llvm-svn: 23682
* (X & Y) & C == 0 if either X&C or Y&C are zeroChris Lattner2005-10-091-2/+6
| | | | llvm-svn: 23678
* remove debugging codeChris Lattner2005-10-071-5/+1
| | | | llvm-svn: 23663
* implement CodeGen/PowerPC/div-2.ll:test2-4 by propagating zero bits throughChris Lattner2005-10-071-1/+23
| | | | | | C-X's llvm-svn: 23662
* fix indentationChris Lattner2005-10-071-57/+57
| | | | llvm-svn: 23660
* Turn sdivs into udivs when we can prove the sign bits are clear. ThisChris Lattner2005-10-071-0/+11
| | | | | | implements CodeGen/PowerPC/div-2.ll llvm-svn: 23659
* Let the combiner handle more casesNate Begeman2005-10-051-1/+4
| | | | llvm-svn: 23641
* implement visitBR_CC so that PowerPC/inverted-bool-compares.ll passesChris Lattner2005-10-051-0/+3
| | | | | | | with the dag combiner. This speeds up espresso by 8%, reaching performance parity with the dag-combiner-disabled llc. llvm-svn: 23636
* fix some pastosChris Lattner2005-10-051-2/+2
| | | | llvm-svn: 23635
* Add a new HandleNode class, which is used to handle (haha) cases in theChris Lattner2005-10-051-6/+5
| | | | | | | dead node elim and dag combiner passes where the root is potentially updated. This fixes a fixme in the dag combiner. llvm-svn: 23634
* Add FP versions of the binary operators, keeping the int and fp worlds seperate.Chris Lattner2005-09-281-21/+40
| | | | | | | | Though I have done extensive testing, it is possible that this will break things in configs I can't test. Please let me know if this causes a problem and I'll fix it ASAP. llvm-svn: 23504
* 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
OpenPOWER on IntegriCloud