summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Print some new nodesChris Lattner2005-04-021-1/+6
| | | | llvm-svn: 21001
* Add ISD::UNDEF nodeNate Begeman2005-04-011-0/+1
| | | | | | | | | Teach the SelectionDAG code how to expand and promote it Have PPC32 LowerCallTo generate ISD::UNDEF for int arg regs used up by fp arguments, but not shadowing their value. This allows us to do the right thing with both fixed and vararg floating point arguments. llvm-svn: 20988
* PCMarker support for DAG and AlphaAndrew Lenharth2005-03-311-0/+1
| | | | llvm-svn: 20965
* Fix a bug where we would incorrectly do a sign ext instead of a zero extChris Lattner2005-03-101-1/+1
| | | | | | | because we were checking the wrong thing. Thanks to andrew for pointing this out! llvm-svn: 20554
* constant fold FP_ROUND_INREG, ZERO_EXTEND_INREG, and SIGN_EXTEND_INREGChris Lattner2005-03-091-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the alpha backend to compile: bool %test(uint %P) { %c = seteq uint %P, 0 ret bool %c } into: test: ldgp $29, 0($27) ZAP $16,240,$0 CMPEQ $0,0,$0 AND $0,1,$0 ret $31,($26),1 instead of: test: ldgp $29, 0($27) ZAP $16,240,$0 ldiq $1,0 ZAP $1,240,$1 CMPEQ $0,$1,$0 AND $0,1,$0 ret $31,($26),1 ... and fixes PR534. llvm-svn: 20534
* Don't rely on doubles comparing identical to each other, which doesn't workChris Lattner2005-02-171-4/+19
| | | | | | for 0.0 and -0.0. llvm-svn: 20230
* Remove the 3 HACK HACK HACKs I put in before, fixing them properly withChris Lattner2005-01-231-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the new TLI that is available. Implement support for handling out of range shifts. This allows us to compile this code (a 64-bit rotate): unsigned long long f3(unsigned long long x) { return (x << 32) | (x >> (64-32)); } into this: f3: mov %EDX, DWORD PTR [%ESP + 4] mov %EAX, DWORD PTR [%ESP + 8] ret GCC produces this: $ gcc t.c -masm=intel -O3 -S -o - -fomit-frame-pointer .. f3: push %ebx mov %ebx, DWORD PTR [%esp+12] mov %ecx, DWORD PTR [%esp+8] mov %eax, %ebx mov %edx, %ecx pop %ebx ret The Simple ISEL produces (eww gross): f3: sub %ESP, 4 mov DWORD PTR [%ESP], %ESI mov %EDX, DWORD PTR [%ESP + 8] mov %ECX, DWORD PTR [%ESP + 12] mov %EAX, 0 mov %ESI, 0 or %EAX, %ECX or %EDX, %ESI mov %ESI, DWORD PTR [%ESP] add %ESP, 4 ret llvm-svn: 19780
* More bugfixes for IA64 shifts.Chris Lattner2005-01-221-2/+2
| | | | llvm-svn: 19739
* Add a nasty hack to fix Alpha/IA64 multiplies by a power of two.Chris Lattner2005-01-221-4/+9
| | | | llvm-svn: 19737
* Remove unneeded line.Chris Lattner2005-01-211-1/+0
| | | | llvm-svn: 19736
* test commitChris Lattner2005-01-211-0/+1
| | | | llvm-svn: 19735
* Unary token factor nodes are unneeded.Chris Lattner2005-01-211-0/+2
| | | | llvm-svn: 19727
* implement add_parts/sub_parts.Chris Lattner2005-01-201-3/+8
| | | | llvm-svn: 19714
* Know some identities about tokenfactor nodes.Chris Lattner2005-01-191-0/+11
| | | | llvm-svn: 19699
* Know some simple identities. This improves codegen for (1LL << N).Chris Lattner2005-01-191-0/+13
| | | | llvm-svn: 19698
* Keep track of the retval type as well.Chris Lattner2005-01-181-2/+5
| | | | llvm-svn: 19670
* Allow setcc operations to have nonbool types.Chris Lattner2005-01-181-33/+35
| | | | llvm-svn: 19656
* Fix the completely broken FP constant folds for setcc's.Chris Lattner2005-01-181-4/+4
| | | | llvm-svn: 19651
* Refactor code into a new method.Chris Lattner2005-01-171-2/+1
| | | | llvm-svn: 19635
* Add assertions.Chris Lattner2005-01-161-0/+31
| | | | llvm-svn: 19596
* Eliminate unneeded extensions.Chris Lattner2005-01-161-0/+9
| | | | llvm-svn: 19577
* Print extra type for nodes with extra type info.Chris Lattner2005-01-151-0/+2
| | | | llvm-svn: 19575
* Common code factored out.Chris Lattner2005-01-151-24/+4
| | | | llvm-svn: 19572
* Add new SIGN_EXTEND_INREG, ZERO_EXTEND_INREG, and FP_ROUND_INREG operators.Chris Lattner2005-01-151-16/+57
| | | | llvm-svn: 19568
* Adjust to CopyFromReg changes, implement deletion of truncating/extendingChris Lattner2005-01-141-1/+24
| | | | | | stores/loads. llvm-svn: 19562
* Start implementing truncating stores and extending loads.Chris Lattner2005-01-141-0/+67
| | | | llvm-svn: 19559
* Add new ImplicitDef node, rename CopyRegSDNode class to RegSDNode.Chris Lattner2005-01-131-1/+2
| | | | llvm-svn: 19535
* Print new node.Chris Lattner2005-01-131-0/+1
| | | | llvm-svn: 19526
* Do not fold (zero_ext (sign_ext V)) -> (sign_ext V), they are not the same.Chris Lattner2005-01-121-2/+2
| | | | | | This fixes llvm-test/SingleSource/Regression/C/casts.c llvm-svn: 19519
* New methodChris Lattner2005-01-121-0/+33
| | | | llvm-svn: 19517
* Print new operations.Chris Lattner2005-01-111-0/+3
| | | | llvm-svn: 19464
* shift X, 0 -> XChris Lattner2005-01-111-0/+6
| | | | llvm-svn: 19453
* Split out SDNode::getOperationName into its own method.Chris Lattner2005-01-101-89/+88
| | | | llvm-svn: 19443
* Implement a couple of more simplifications. This lets us codegen:Chris Lattner2005-01-101-12/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int test2(int * P, int* Q, int A, int B) { return P+A == P; } into: test2: movl 4(%esp), %eax movl 12(%esp), %eax shll $2, %eax cmpl $0, %eax sete %al movzbl %al, %eax ret instead of: test2: movl 4(%esp), %eax movl 12(%esp), %ecx leal (%eax,%ecx,4), %ecx cmpl %eax, %ecx sete %al movzbl %al, %eax ret ICC is producing worse code: test2: movl 4(%esp), %eax #8.5 movl 12(%esp), %edx #8.5 lea (%edx,%edx), %ecx #9.9 addl %ecx, %ecx #9.9 addl %eax, %ecx #9.9 cmpl %eax, %ecx #9.16 movl $0, %eax #9.16 sete %al #9.16 ret #9.16 as is GCC (looks like our old code): test2: movl 4(%esp), %edx movl 12(%esp), %eax leal (%edx,%eax,4), %ecx cmpl %edx, %ecx sete %al movzbl %al, %eax ret llvm-svn: 19430
* Fix incorrect constant folds, fixing Stepanov after the SHR patch.Chris Lattner2005-01-101-4/+4
| | | | llvm-svn: 19429
* Constant fold shifts, turning this loop:Chris Lattner2005-01-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .LBB_Z5test0PdS__3: # no_exit.1 fldl data(,%eax,8) fldl 24(%esp) faddp %st(1) fstl 24(%esp) incl %eax movl $16000, %ecx sarl $3, %ecx cmpl %eax, %ecx fstpl 16(%esp) #FP_REG_KILL jg .LBB_Z5test0PdS__3 # no_exit.1 into: .LBB_Z5test0PdS__3: # no_exit.1 fldl data(,%eax,8) fldl 24(%esp) faddp %st(1) fstl 24(%esp) incl %eax cmpl $2000, %eax fstpl 16(%esp) #FP_REG_KILL jl .LBB_Z5test0PdS__3 # no_exit.1 llvm-svn: 19427
* Add some folds for == and != comparisons. This allows us toChris Lattner2005-01-091-41/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | codegen this loop in stepanov: no_exit.i: ; preds = %entry, %no_exit.i, %then.i, %_Z5checkd.exit %i.0.0 = phi int [ 0, %entry ], [ %i.0.0, %no_exit.i ], [ %inc.0, %_Z5checkd.exit ], [ %inc.012, %then.i ] ; <int> [#uses=3] %indvar = phi uint [ %indvar.next, %no_exit.i ], [ 0, %entry ], [ 0, %then.i ], [ 0, %_Z5checkd.exit ] ; <uint> [#uses=3] %result_addr.i.0 = phi double [ %tmp.4.i.i, %no_exit.i ], [ 0.000000e+00, %entry ], [ 0.000000e+00, %then.i ], [ 0.000000e+00, %_Z5checkd.exit ] ; <double> [#uses=1] %first_addr.0.i.2.rec = cast uint %indvar to int ; <int> [#uses=1] %first_addr.0.i.2 = getelementptr [2000 x double]* %data, int 0, uint %indvar ; <double*> [#uses=1] %inc.i.rec = add int %first_addr.0.i.2.rec, 1 ; <int> [#uses=1] %inc.i = getelementptr [2000 x double]* %data, int 0, int %inc.i.rec ; <double*> [#uses=1] %tmp.3.i.i = load double* %first_addr.0.i.2 ; <double> [#uses=1] %tmp.4.i.i = add double %result_addr.i.0, %tmp.3.i.i ; <double> [#uses=2] %tmp.2.i = seteq double* %inc.i, getelementptr ([2000 x double]* %data, int 0, int 2000) ; <bool> [#uses=1] %indvar.next = add uint %indvar, 1 ; <uint> [#uses=1] br bool %tmp.2.i, label %_Z10accumulateIPddET0_T_S2_S1_.exit, label %no_exit.i To this: .LBB_Z4testIPddEvT_S1_T0__1: # no_exit.i fldl data(,%eax,8) fldl 16(%esp) faddp %st(1) fstpl 16(%esp) incl %eax movl %eax, %ecx shll $3, %ecx cmpl $16000, %ecx #FP_REG_KILL jne .LBB_Z4testIPddEvT_S1_T0__1 # no_exit.i instead of this: .LBB_Z4testIPddEvT_S1_T0__1: # no_exit.i fldl data(,%eax,8) fldl 16(%esp) faddp %st(1) fstpl 16(%esp) incl %eax leal data(,%eax,8), %ecx leal data+16000, %edx cmpl %edx, %ecx #FP_REG_KILL jne .LBB_Z4testIPddEvT_S1_T0__1 # no_exit.i llvm-svn: 19425
* Fix VC++ compilation errorJeff Cohen2005-01-091-0/+1
| | | | llvm-svn: 19423
* Print the DAG out more like a DAG in nested format.Chris Lattner2005-01-091-2/+18
| | | | llvm-svn: 19422
* Print out nodes sorted by their address to make it easier to find them in a ↵Chris Lattner2005-01-091-2/+5
| | | | | | list. llvm-svn: 19421
* Add a simple transformation. This allows us to compile one of the innerChris Lattner2005-01-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loops in stepanov to this: .LBB_Z5test0PdS__2: # no_exit.1 fldl data(,%eax,8) fldl 24(%esp) faddp %st(1) fstl 24(%esp) incl %eax cmpl $2000, %eax fstpl 16(%esp) #FP_REG_KILL jl .LBB_Z5test0PdS__2 instead of this: .LBB_Z5test0PdS__2: # no_exit.1 fldl data(,%eax,8) fldl 24(%esp) faddp %st(1) fstl 24(%esp) incl %eax movl $data, %ecx movl %ecx, %edx addl $16000, %edx subl %ecx, %edx movl %edx, %ecx sarl $2, %ecx shrl $29, %ecx addl %ecx, %edx sarl $3, %edx cmpl %edx, %eax fstpl 16(%esp) #FP_REG_KILL jl .LBB_Z5test0PdS__2 The old instruction selector produced: .LBB_Z5test0PdS__2: # no_exit.1 fldl 24(%esp) faddl data(,%eax,8) fstl 24(%esp) movl %eax, %ecx incl %ecx incl %eax leal data+16000, %edx movl $data, %edi subl %edi, %edx movl %edx, %edi sarl $2, %edi shrl $29, %edi addl %edi, %edx sarl $3, %edx cmpl %edx, %ecx fstpl 16(%esp) #FP_REG_KILL jl .LBB_Z5test0PdS__2 # no_exit.1 Which is even worse! llvm-svn: 19419
* Add support for FP->INT conversions and back.Chris Lattner2005-01-081-0/+11
| | | | llvm-svn: 19369
* 1ULL << 64 is undefined, don't do it.Chris Lattner2005-01-081-2/+3
| | | | llvm-svn: 19365
* Fix a pointer invalidation problem. This fixes Generic/badarg6.llChris Lattner2005-01-071-13/+7
| | | | llvm-svn: 19361
* Fold conditional branches on constants away.Chris Lattner2005-01-071-0/+6
| | | | llvm-svn: 19360
* Fix a thinko in the reassociation code, fixing Generic/badlive.llChris Lattner2005-01-071-1/+1
| | | | llvm-svn: 19359
* Simplify: truncate ({zero|sign}_extend (X))Chris Lattner2005-01-071-0/+9
| | | | llvm-svn: 19353
* Implement RemoveDeadNodesChris Lattner2005-01-071-0/+119
| | | | llvm-svn: 19345
* Complete rewrite of the SelectionDAG class.Chris Lattner2005-01-071-106/+758
| | | | llvm-svn: 19327
* Add #include <iostream> since Value.h does not #include it any more.Reid Spencer2004-07-041-0/+2
| | | | llvm-svn: 14622
OpenPOWER on IntegriCloud