summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Constant fold ctpop/ctlz/cttz, and a couple other small cleanupsNate Begeman2006-01-161-2/+58
| | | | llvm-svn: 25357
* add a missing node nameChris Lattner2006-01-151-0/+1
| | | | llvm-svn: 25327
* add stacksave/stackrestore nodesChris Lattner2006-01-131-2/+6
| | | | llvm-svn: 25270
* ignore register #0Evan Cheng2006-01-111-1/+1
| | | | llvm-svn: 25223
* Add bswap, rotl, and rotr nodesNate Begeman2006-01-111-0/+11
| | | | | | | | | Add dag combiner code to recognize rotl, rotr Add ppc code to match rotl Targets should add rotl/rotr patterns if they have them llvm-svn: 25222
* New getNode() variants.Evan Cheng2006-01-091-14/+0
| | | | llvm-svn: 25156
* Added initial support for DEBUG_LABEL allowing debug specific labels to beJim Laskey2006-01-051-0/+1
| | | | | | inserted in the code. llvm-svn: 25104
* Make sure to pass the offset into the new node, so that we don't silentlyNate Begeman2005-12-301-1/+1
| | | | | | drop it on the floor. llvm-svn: 25044
* Fold bitconv(bitconv(x)) -> x. We now compile this:Chris Lattner2005-12-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | void foo(double); void bar(double X) { foo(X); } to this: bar: save -96, %o6, %o6 or %g0, %i0, %o0 or %g0, %i1, %o1 call foo nop restore %g0, %g0, %g0 retl nop instead of this: bar: save -112, %o6, %o6 st %i1, [%i6+-4] st %i0, [%i6+-8] ldd [%i6+-8], %f0 std %f0, [%i6+-16] ld [%i6+-12], %o1 ld [%i6+-16], %o0 call foo nop restore %g0, %g0, %g0 retl nop on V8. llvm-svn: 24981
* constant fold bits_convert in getNode and in the dag combiner for fp<->intChris Lattner2005-12-231-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conversions. This allows V8 to compiles this: void %test() { call float %test2( float 1.000000e+00, float 2.000000e+00, double 3.000000e+00, double* null ) ret void } into: test: save -96, %o6, %o6 sethi 0, %o3 sethi 1049088, %o2 sethi 1048576, %o1 sethi 1040384, %o0 or %g0, %o3, %o4 call test2 nop restore %g0, %g0, %g0 retl nop instead of: test: save -112, %o6, %o6 sethi 0, %o4 sethi 1049088, %l0 st %o4, [%i6+-12] st %l0, [%i6+-16] ld [%i6+-12], %o3 ld [%i6+-16], %o2 sethi 1048576, %o1 sethi 1040384, %o0 call test2 nop restore %g0, %g0, %g0 retl nop llvm-svn: 24980
* add very simple support for the BIT_CONVERT nodeChris Lattner2005-12-231-0/+7
| | | | llvm-svn: 24970
* remove dead codeChris Lattner2005-12-221-1/+0
| | | | llvm-svn: 24965
* Added a hook to print out names of target specific DAG nodes.Evan Cheng2005-12-201-5/+8
| | | | llvm-svn: 24877
* Print out opcode number if it's an unknown target node.Evan Cheng2005-12-191-1/+6
| | | | llvm-svn: 24869
* Fix a case where the DAG Combiner would accidentally CSE flag-producing nodes,Chris Lattner2005-12-191-1/+6
| | | | | | creating graphs that cannot be scheduled. llvm-svn: 24866
* Added source file/line correspondence for dwarf (PowerPC only at this point.)Jim Laskey2005-12-161-0/+1
| | | | llvm-svn: 24748
* Added new getNode and getTargetNode variants for X86 stores.Evan Cheng2005-12-101-60/+73
| | | | llvm-svn: 24653
* Teach the SelectionDAG ISel how to turn ConstantPacked values intoNate Begeman2005-12-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constant nodes with vector types. Also teach the asm printer how to print ConstantPacked constant pool entries. This allows us to generate altivec code such as the following, which adds a vector constantto a packed float. LCPI1_0: <4 x float> < float 0.0e+0, float 0.0e+0, float 0.0e+0, float 1.0e+0 > .space 4 .space 4 .space 4 .long 1065353216 ; float 1 .text .align 4 .globl _foo _foo: lis r2, ha16(LCPI1_0) la r2, lo16(LCPI1_0)(r2) li r4, 0 lvx v0, r4, r2 lvx v1, r4, r3 vaddfp v0, v1, v0 stvx v0, r4, r3 blr For the llvm code: void %foo(<4 x float> * %a) { entry: %tmp1 = load <4 x float> * %a; %tmp2 = add <4 x float> %tmp1, < float 0.0, float 0.0, float 0.0, float 1.0 > store <4 x float> %tmp2, <4 x float> *%a ret void } llvm-svn: 24616
* 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
OpenPOWER on IntegriCloud