llvm-6502/lib/Target
Chris Lattner 9f1b531090 Second half of my fixed-sized-alloca patch. This folds the LEA to compute
the alloca address into common operations like loads/stores.

In a simple testcase like this (which is just designed to excersize the
alloca A, nothing more):

int %test(int %X, bool %C) {
        %A = alloca int
        store int %X, int* %A
        store int* %A, int** %G
        br bool %C, label %T, label %F
T:
        call int %test(int 1, bool false)
        %V = load int* %A
        ret int %V
F:
        call int %test(int 123, bool true)
        %V2 = load int* %A
        ret int %V2
}

We now generate:

test:
        sub %ESP, 12
        mov %EAX, DWORD PTR [%ESP + 16]
        mov %CL, BYTE PTR [%ESP + 20]
***     mov DWORD PTR [%ESP + 8], %EAX
        mov %EAX, OFFSET G
        lea %EDX, DWORD PTR [%ESP + 8]
        mov DWORD PTR [%EAX], %EDX
        test %CL, %CL
        je .LBB2 # PC rel: F
.LBB1:  # T
        mov DWORD PTR [%ESP], 1
        mov DWORD PTR [%ESP + 4], 0
        call test
***     mov %EAX, DWORD PTR [%ESP + 8]
        add %ESP, 12
        ret
.LBB2:  # F
        mov DWORD PTR [%ESP], 123
        mov DWORD PTR [%ESP + 4], 1
        call test
***     mov %EAX, DWORD PTR [%ESP + 8]
        add %ESP, 12
        ret

Instead of:

test:
        sub %ESP, 20
        mov %EAX, DWORD PTR [%ESP + 24]
        mov %CL, BYTE PTR [%ESP + 28]
***     lea %EDX, DWORD PTR [%ESP + 16]
***     mov DWORD PTR [%EDX], %EAX
        mov %EAX, OFFSET G
        mov DWORD PTR [%EAX], %EDX
        test %CL, %CL
***     mov DWORD PTR [%ESP + 12], %EDX
        je .LBB2 # PC rel: F
.LBB1:  # T
        mov DWORD PTR [%ESP], 1
        mov %EAX, 0
        mov DWORD PTR [%ESP + 4], %EAX
        call test
***     mov %EAX, DWORD PTR [%ESP + 12]
***     mov %EAX, DWORD PTR [%EAX]
        add %ESP, 20
        ret
.LBB2:  # F
        mov DWORD PTR [%ESP], 123
        mov %EAX, 1
        mov DWORD PTR [%ESP + 4], %EAX
        call test
***     mov %EAX, DWORD PTR [%ESP + 12]
***     mov %EAX, DWORD PTR [%EAX]
        add %ESP, 20
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13557 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-13 15:12:43 +00:00
..
CBackend syntactically loopify natural loops so that the GCC loop optimizer can find them. This should *dramatically* improve the performance of CBE compiled code on targets that depend on GCC's loop optimizations (like PPC) 2004-05-09 20:41:32 +00:00
PowerPC fine grainify namespacification 2004-02-28 19:53:18 +00:00
Sparc Add support for widening integral casts. 2004-05-08 06:36:14 +00:00
SparcV8 Add support for widening integral casts. 2004-05-08 06:36:14 +00:00
SparcV9 Updating my versions of ModuloScheduling in cvs. Still not complete. 2004-05-08 16:12:10 +00:00
X86 Second half of my fixed-sized-alloca patch. This folds the LEA to compute 2004-05-13 15:12:43 +00:00
Makefile Remove ghostly directory from the build 2004-03-11 04:42:41 +00:00
MRegisterInfo.cpp Put all LLVM code into the llvm namespace, as per bug 109. 2003-11-11 22:41:34 +00:00
Target.td Expose the "Other" value type to tablegen targets 2004-02-11 03:08:45 +00:00
TargetData.cpp Fix typo. 2004-04-14 21:21:56 +00:00
TargetFrameInfo.cpp Move implementations of functions here, which avoids #including <cstdlib> in the 2004-03-11 23:52:43 +00:00
TargetInstrInfo.cpp Adjust to change in TII ctor arguments 2004-02-29 06:31:44 +00:00
TargetMachine.cpp make -print-machineinstrs work for both SparcV9 and X86 2004-03-04 19:16:23 +00:00
TargetSchedInfo.cpp Changed CPUResource to allow access to maxnum users. 2004-05-08 16:12:50 +00:00