summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* restore old srcValueNode behavior and try to to work around itAndrew Lenharth2005-06-291-0/+2
| | | | llvm-svn: 22315
* tracking the instructions causing loads and stores provides more information ↵Andrew Lenharth2005-06-291-2/+0
| | | | | | than just the pointer being loaded or stored llvm-svn: 22311
* Fix bug 537 test 2, which checks to make sure that we fold A+(B-A) -> B forNate Begeman2005-06-161-2/+7
| | | | | | | integer types. Add a couple checks to not perform these kinds of transform on floating point values. llvm-svn: 22228
* Add some simplifications for MULH[SU]. This allows us to compile this:Chris Lattner2005-05-151-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | long %bar(long %X) { %Y = mul long %X, 4294967297 ret long %Y } to this: l1_bar: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, %EAX add %EDX, DWORD PTR [%ESP + 8] ret instead of: l1_bar: mov %ECX, DWORD PTR [%ESP + 4] mov %EDX, 1 mov %EAX, %ECX mul %EDX add %EDX, %ECX add %EDX, DWORD PTR [%ESP + 8] mov %EAX, %ECX ret llvm-svn: 22044
* remove special case hacks for readport/readio from the binary operatorChris Lattner2005-05-141-6/+1
| | | | | | codepath llvm-svn: 22019
* Implement fixme's by memoizing nodes.Chris Lattner2005-05-141-9/+21
| | | | llvm-svn: 22018
* Turn this into a wrapper for a simpler version of getNode.Chris Lattner2005-05-141-8/+7
| | | | llvm-svn: 22016
* Eliminate special purpose hacks for dynamic_stack_alloc.Chris Lattner2005-05-141-13/+1
| | | | llvm-svn: 22015
* Use the general mechanism for creating multi-value nodes instead of usingChris Lattner2005-05-141-34/+30
| | | | | | special case hacks. llvm-svn: 22014
* Wrap long line, actually add node to the graph.Chris Lattner2005-05-141-1/+3
| | | | llvm-svn: 22011
* add a getNode() version that allows construction of any node type.Chris Lattner2005-05-141-9/+33
| | | | llvm-svn: 22009
* Handle TAILCALL nodeChris Lattner2005-05-131-0/+1
| | | | llvm-svn: 21957
* fix a bad typeoChris Lattner2005-05-121-2/+2
| | | | llvm-svn: 21917
* rename the ADJCALLSTACKDOWN/ADJCALLSTACKUP nodes to be CALLSEQ_START/BEGIN.Chris Lattner2005-05-121-6/+6
| | | | llvm-svn: 21915
* handle a common case generated by the uint64 -> FP code path betterChris Lattner2005-05-121-1/+17
| | | | llvm-svn: 21888
* Make legalize a bit more efficient, and canonicalize sub X, C -> add X, -CChris Lattner2005-05-121-6/+7
| | | | llvm-svn: 21882
* Do not memoize ADJCALLSTACKDOWN nodes, provide a method to hack on them.Chris Lattner2005-05-111-3/+24
| | | | llvm-svn: 21871
* Print bit count nodes correctlyChris Lattner2005-05-111-0/+6
| | | | llvm-svn: 21855
* Silence some VC++ warningsJeff Cohen2005-05-101-2/+2
| | | | llvm-svn: 21838
* Add support for READPORT, WRITEPORT, READIO, WRITEIOChris Lattner2005-05-091-1/+10
| | | | llvm-svn: 21824
* Fold shifts into subsequent SHL's. These shifts often arise due to addrsesChris Lattner2005-05-091-0/+28
| | | | | | arithmetic lowering. llvm-svn: 21818
* Don't use the load/store instruction as the source pointer, use the pointerChris Lattner2005-05-091-0/+2
| | | | | | being stored/loaded through! llvm-svn: 21806
* memoize all nodes, even null Value* nodes. Do not add two token chain outputsChris Lattner2005-05-091-7/+5
| | | | llvm-svn: 21805
* Print SrcValue nodes correctlyChris Lattner2005-05-091-0/+6
| | | | llvm-svn: 21803
* Implement count leading zeros (ctlz), count trailing zeros (cttz), and countAndrew Lenharth2005-05-031-3/+6
| | | | | | | | | population (ctpop). Generic lowering is implemented, however only promotion is implemented for SelectionDAG at the moment. More coming soon. llvm-svn: 21676
* Add FSQRT, FSIN, FCOS nodes, patch contributed by Morten OfstadChris Lattner2005-04-281-1/+4
| | | | llvm-svn: 21605
* Implement Value* tracking for loads and stores in the selection DAG. This ↵Andrew Lenharth2005-04-271-9/+33
| | | | | | | | enables one to use alias analysis in the backends. (TRUNK)Stores and (EXT|ZEXT|SEXT)Loads have an extra SDOperand which is a SrcValueSDNode which contains the Value*. Note that if the operation is introduced by the backend, it will still have the operand, but the value* will be null. llvm-svn: 21599
* Fold (X > -1) | (Y > -1) --> (X&Y > -1)Chris Lattner2005-04-261-1/+3
| | | | llvm-svn: 21552
* implement some more logical compares with constants, so that:Chris Lattner2005-04-251-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int foo1(int x, int y) { int t1 = x >= 0; int t2 = y >= 0; return t1 & t2; } int foo2(int x, int y) { int t1 = x == -1; int t2 = y == -1; return t1 & t2; } produces: _foo1: or r2, r4, r3 srwi r2, r2, 31 xori r3, r2, 1 blr _foo2: and r2, r4, r3 addic r2, r2, 1 li r2, 0 addze r3, r2 blr instead of: _foo1: srwi r2, r4, 31 xori r2, r2, 1 srwi r3, r3, 31 xori r3, r3, 1 and r3, r2, r3 blr _foo2: addic r2, r4, 1 li r2, 0 addze r2, r2 addic r3, r3, 1 li r3, 0 addze r3, r3 and r3, r2, r3 blr llvm-svn: 21547
* Codegen x < 0 | y < 0 as (x|y) < 0. This allows us to compile this to:Chris Lattner2005-04-251-1/+4
| | | | | | | | | | | | | | | | | _foo: or r2, r4, r3 srwi r3, r2, 31 blr instead of: _foo: srwi r2, r4, 31 srwi r3, r3, 31 or r3, r2, r3 blr llvm-svn: 21544
* Convert tabs to spacesMisha Brukman2005-04-221-6/+4
| | | | llvm-svn: 21439
* Remove trailing whitespaceMisha Brukman2005-04-211-31/+31
| | | | llvm-svn: 21420
* Improve and elimination. On PPC, for:Chris Lattner2005-04-211-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | bool %test(int %X) { %Y = and int %X, 8 %Z = setne int %Y, 0 ret bool %Z } we now generate this: rlwinm r2, r3, 0, 28, 28 srwi r3, r2, 3 instead of this: rlwinm r2, r3, 0, 28, 28 srwi r2, r2, 3 rlwinm r3, r2, 0, 31, 31 I'll leave it to Nate to get it down to one instruction. :) --------------------------------------------------------------------- llvm-svn: 21391
* Fold (x & 8) != 0 and (x & 8) == 8 into (x & 8) >> 3.Chris Lattner2005-04-211-0/+22
| | | | | | | | | | | | | | | | | | | This turns this PPC code: rlwinm r2, r3, 0, 28, 28 cmpwi cr7, r2, 8 mfcr r2 rlwinm r3, r2, 31, 31, 31 into this: rlwinm r2, r3, 0, 28, 28 srwi r2, r2, 3 rlwinm r3, r2, 0, 31, 31 Next up, nuking the extra and. llvm-svn: 21390
* Fold setcc of MVT::i1 operands into logical operationsChris Lattner2005-04-181-0/+39
| | | | llvm-svn: 21319
* Another minor simplification: handle setcc (zero_extend x), c -> setcc(x, c')Chris Lattner2005-04-181-0/+45
| | | | llvm-svn: 21318
* Another simple xformChris Lattner2005-04-181-0/+8
| | | | llvm-svn: 21317
* Fold:Chris Lattner2005-04-181-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | // (X != 0) | (Y != 0) -> (X|Y != 0) // (X == 0) & (Y == 0) -> (X|Y == 0) Compiling this: int %bar(int %a, int %b) { entry: %tmp.1 = setne int %a, 0 %tmp.2 = setne int %b, 0 %tmp.3 = or bool %tmp.1, %tmp.2 %retval = cast bool %tmp.3 to int ret int %retval } to this: _bar: or r2, r3, r4 addic r3, r2, -1 subfe r3, r3, r2 blr instead of: _bar: addic r2, r3, -1 subfe r2, r2, r3 addic r3, r4, -1 subfe r3, r3, r4 or r3, r2, r3 blr llvm-svn: 21316
* Make the AND elimination operation recursive and significantly more powerful,Chris Lattner2005-04-181-26/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eliminating an and for Nate's testcase: int %bar(int %a, int %b) { entry: %tmp.1 = setne int %a, 0 %tmp.2 = setne int %b, 0 %tmp.3 = or bool %tmp.1, %tmp.2 %retval = cast bool %tmp.3 to int ret int %retval } generating: _bar: addic r2, r3, -1 subfe r2, r2, r3 addic r3, r4, -1 subfe r3, r3, r4 or r3, r2, r3 blr instead of: _bar: addic r2, r3, -1 subfe r2, r2, r3 addic r3, r4, -1 subfe r3, r3, r4 or r2, r2, r3 rlwinm r3, r2, 0, 31, 31 blr llvm-svn: 21315
* Add a couple missing transforms in getSetCC that were triggering assertionsNate Begeman2005-04-141-1/+8
| | | | | | in the PPC Pattern ISel llvm-svn: 21297
* Disbale the broken fold of shift + sz[ext] for nowNate Begeman2005-04-131-7/+30
| | | | | | | | Move the transform for select (a < 0) ? b : 0 into the dag from ppc isel Enable the dag to fold and (setcc, 1) -> setcc for targets where setcc always produces zero or one. llvm-svn: 21291
* fix an infinite loopChris Lattner2005-04-131-1/+1
| | | | llvm-svn: 21289
* fix some serious miscompiles on ia64, alpha, and ppcChris Lattner2005-04-131-1/+1
| | | | llvm-svn: 21288
* avoid work when possible, perhaps fix the problem nate and andrew are seeingChris Lattner2005-04-131-0/+1
| | | | | | with != 0 comparisons vanishing. llvm-svn: 21287
* add back the optimization that Nate added for shl X, (zext_inreg y)Chris Lattner2005-04-131-2/+23
| | | | llvm-svn: 21273
* Oops, remove these too.Chris Lattner2005-04-131-6/+2
| | | | llvm-svn: 21272
* Remove all foldings of ZERO_EXTEND_INREG, moving them to work for AND nodesChris Lattner2005-04-131-41/+46
| | | | | | instead. OVerall, this increases the amount of folding we can do. llvm-svn: 21265
* Fold shift x, [sz]ext(y) -> shift x, yNate Begeman2005-04-121-0/+16
| | | | llvm-svn: 21262
* Fold shift by size larger than type size to undefNate Begeman2005-04-121-11/+4
| | | | | | Make llvm undef values generate ISD::UNDEF nodes llvm-svn: 21261
* Remove some redundant checks, add a couple of new ones. This allows us toChris Lattner2005-04-121-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compile this: int foo (unsigned long a, unsigned long long g) { return a >= g; } To: foo: movl 8(%esp), %eax cmpl %eax, 4(%esp) setae %al cmpl $0, 12(%esp) sete %cl andb %al, %cl movzbl %cl, %eax ret instead of: foo: movl 8(%esp), %eax cmpl %eax, 4(%esp) setae %al movzbw %al, %cx movl 12(%esp), %edx cmpl $0, %edx sete %al movzbw %al, %ax cmpl $0, %edx cmove %cx, %ax movzbl %al, %eax ret llvm-svn: 21244
OpenPOWER on IntegriCloud