1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

16793 Commits

Author SHA1 Message Date
Chris Lattner
d61491dea2 Implement 8-bit multiply for X86.
llvm-svn: 19435
2005-01-10 20:55:48 +00:00
Chris Lattner
b35b30c283 Rework constant pool handling so that function constant pools are no longer
leaked to the system.  Now they are destroyed with the JITMemoryManager is
destroyed.

llvm-svn: 19434
2005-01-10 18:23:22 +00:00
Jeff Cohen
8b03a55724 Apply feedback from Chris.
llvm-svn: 19432
2005-01-10 04:23:32 +00:00
Jeff Cohen
a7f1ae5dc0 Apply feed back from Chris:
1. Rename createLoaderPass to CreateProfileLoaderPass
  2. Opt shouldn't use the pass registered in CodeGen.

llvm-svn: 19431
2005-01-10 03:56:27 +00:00
Chris Lattner
02236df007 Implement a couple of more simplifications. This lets us codegen:
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
2005-01-10 02:03:02 +00:00
Chris Lattner
8d09b03ed1 Fix incorrect constant folds, fixing Stepanov after the SHR patch.
llvm-svn: 19429
2005-01-10 01:16:03 +00:00
Jeff Cohen
8ab3646b21 Update System project in Visual Studio to reflect renamed files.
llvm-svn: 19428
2005-01-10 00:50:11 +00:00
Chris Lattner
9d479d4a34 Constant fold shifts, turning this loop:
.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
2005-01-10 00:07:15 +00:00
Reid Spencer
283688b80d Rename Unix/*.cpp and Win32/*.cpp to have a *.inc suffix so that the silly
gdb debugger doesn't get confused on which file it is reading (the one in
lib/System or the one in lib/System/{Win32,Unix})

llvm-svn: 19426
2005-01-09 23:29:00 +00:00
Chris Lattner
59d7066da8 Add some folds for == and != comparisons. This allows us to
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
2005-01-09 20:52:51 +00:00
Jeff Cohen
f692cd303d Add last four createXxxPass functions
llvm-svn: 19424
2005-01-09 20:42:52 +00:00
Jeff Cohen
91dd6d2d20 Fix VC++ compilation error
llvm-svn: 19423
2005-01-09 20:41:56 +00:00
Chris Lattner
fa06762d0e Print the DAG out more like a DAG in nested format.
llvm-svn: 19422
2005-01-09 20:38:33 +00:00
Chris Lattner
e3b9f22967 Print out nodes sorted by their address to make it easier to find them in a list.
llvm-svn: 19421
2005-01-09 20:26:36 +00:00
Chris Lattner
fcab5f75c0 Codegen (Reg|imm)+&GV as an LEA, because we cannot put it into the immediate field
of an ADDri (due to current restrictions on MachineOperand :( ).  This allows
us to generate:

        leal Data+16000, %edx

instead of:

        movl $Data, %edx
        addl $16000, %edx

llvm-svn: 19420
2005-01-09 20:20:29 +00:00
Chris Lattner
82caa0dc2e Add a simple transformation. This allows us to compile one of the inner
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
2005-01-09 20:09:57 +00:00
Chris Lattner
35375c11bf Fix copy and pasto's for FP -> Int. This fixes fldry
llvm-svn: 19418
2005-01-09 19:49:59 +00:00
Chris Lattner
d674d08230 Fix a bug legalizing call instructions (make sure to remember all result
values), and eliminate some switch statements.

llvm-svn: 19417
2005-01-09 19:43:23 +00:00
Chris Lattner
ac23355362 Fix a minor bug legalizing dynamic_stackalloc. This allows us to compile
std::__pad<wchar_t, std::char_traits<wchar_t> >::_S_pad(std::ios_base&, wchar_t, wchar_t*, wchar_t const*, int, int, bool)

from libstdc++

llvm-svn: 19416
2005-01-09 19:07:54 +00:00
Chris Lattner
b3e31c6def Teach legalize to deal with DYNAMIC_STACKALLOC (aka a dynamic llvm alloca)
llvm-svn: 19415
2005-01-09 19:03:49 +00:00
Chris Lattner
45155a3dee Initial implementation of FP->INT and INT->FP casts
Also, fix zero_extend from bool to i8, which fixes Shootout/objinst.

llvm-svn: 19414
2005-01-09 18:52:44 +00:00
Jeff Cohen
6827f061cc Get lib/Analysis/DataStructure to compile with VC++
llvm-svn: 19412
2005-01-09 04:18:28 +00:00
Jeff Cohen
cbd3387b66 Workaround a VC++ bug. Microsoft puts the hash_map class in namespace stdext, but
this classes uses a utility function in namespace std.  But Microsoft apparently
assumes everyone will "using namespace std;".  As LLVM doesn't....  Add a
"use std::_Distance;" to get it working.

llvm-svn: 19411
2005-01-09 04:13:09 +00:00
Chris Lattner
9ca9b20447 Fix a subtle bug involving constant expr casts from int to fp
llvm-svn: 19410
2005-01-09 01:49:29 +00:00
Chris Lattner
cc18c057cf Handle static alloca arguments to PHI nodes.
llvm-svn: 19409
2005-01-09 01:16:24 +00:00
Chris Lattner
c5e53c07fd Implement varargs and returnaddress/frameaddress intrinsics. With this
patch, all of SingleSource/UnitTests passes.

llvm-svn: 19408
2005-01-09 00:01:27 +00:00
Chris Lattner
3454e31bba Use new interfaces to correctly lower varargs and return/frame address intrinsics.
llvm-svn: 19407
2005-01-09 00:00:49 +00:00
Chris Lattner
42dd85fc56 Add interfaces to lower varargs and return/frame address intrinsics.
llvm-svn: 19406
2005-01-09 00:00:31 +00:00
Jeff Cohen
2de841855e Test fails on all platforms, not just linux
llvm-svn: 19405
2005-01-08 23:44:03 +00:00
Chris Lattner
aad3ca491d Add support for llvm.setjmp and longjmp. Only 3 SingleSource/UnitTests fail now.
llvm-svn: 19404
2005-01-08 22:48:57 +00:00
Jeff Cohen
3cd512f524 Fix VC++ compilation error
llvm-svn: 19403
2005-01-08 22:44:06 +00:00
Jeff Cohen
6c0db8d863 Add even more missing createXxxPass functions.
llvm-svn: 19402
2005-01-08 22:01:16 +00:00
Chris Lattner
e4b0ac5acf rename linscan -> LLCBETA as it should be
llvm-svn: 19401
2005-01-08 21:03:58 +00:00
Chris Lattner
ca81756527 Okay 15th time is the charm. Looking at the vector size is useless as it
gets clobbered by a previous statement.  This fixes all calls finally.

llvm-svn: 19399
2005-01-08 20:51:36 +00:00
Chris Lattner
85816cff9a Okay, my off by one was actually off by two. This fixes Generic/2003-07-07-BadLongConst.ll
llvm-svn: 19398
2005-01-08 20:39:31 +00:00
Chris Lattner
3b52b2f6c2 Tighten up assertions.
llvm-svn: 19397
2005-01-08 20:35:13 +00:00
Chris Lattner
2d68cb6cf4 Fix off by one error
llvm-svn: 19396
2005-01-08 20:31:34 +00:00
Chris Lattner
9dc8275f47 Allow arrays to have more than 4G elements.
llvm-svn: 19395
2005-01-08 20:19:51 +00:00
Chris Lattner
1a057a2b37 Allow array types to have 64-bit size.
llvm-svn: 19394
2005-01-08 20:19:27 +00:00
Jeff Cohen
aef3f70921 Use size_t instead of long to represent memory usage. long is 32 bits
on 64-bit Windows.

llvm-svn: 19393
2005-01-08 20:15:57 +00:00
Chris Lattner
7a6914d3fc Silence warnings
llvm-svn: 19392
2005-01-08 20:13:44 +00:00
Chris Lattner
ed92fd75e8 Silence VS warnings.
llvm-svn: 19391
2005-01-08 20:13:19 +00:00
Chris Lattner
f1c684b3a2 Silence VS warnings.
llvm-svn: 19390
2005-01-08 20:07:03 +00:00
Chris Lattner
a4a16f17a3 Silence VS warnings
llvm-svn: 19389
2005-01-08 20:05:34 +00:00
Chris Lattner
c23687789e Silence VS warnings
llvm-svn: 19388
2005-01-08 19:59:10 +00:00
Chris Lattner
911dca53ee Adjust prototype
llvm-svn: 19387
2005-01-08 19:57:49 +00:00
Chris Lattner
2dafaac5d1 Silence warnings from VS
llvm-svn: 19386
2005-01-08 19:55:00 +00:00
Chris Lattner
104064bf2c Silence VS warnings
llvm-svn: 19385
2005-01-08 19:53:50 +00:00
Chris Lattner
a58b3f48ef Silence VS warnings.
llvm-svn: 19384
2005-01-08 19:52:31 +00:00
Chris Lattner
c2821461e9 Fix VS warnings
llvm-svn: 19383
2005-01-08 19:48:40 +00:00