LLVM backend for 6502
Go to file
Chris Lattner 0afa8e348e Implement a target independent optimization to codegen arguments only into
the basic block that uses them if possible.  This is a big win on X86, as it
lets us fold the argument loads into instructions and reduce register pressure
(by not loading all of the arguments in the entry block).

For this (contrived to show the optimization) testcase:

int %argtest(int %A, int %B) {
        %X = sub int 12345, %A
        br label %L
L:
        %Y = add int %X, %B
        ret int %Y
}

we used to produce:

argtest:
        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EAX, 12345
        sub %EAX, %ECX
        mov %EDX, DWORD PTR [%ESP + 8]
.LBBargtest_1:  # L
        add %EAX, %EDX
        ret


now we produce:

argtest:
        mov %EAX, 12345
        sub %EAX, DWORD PTR [%ESP + 4]
.LBBargtest_1:  # L
        add %EAX, DWORD PTR [%ESP + 8]
        ret

This also fixes the FIXME in the code.

BTW, this occurs in real code.  164.gzip shrinks from 8623 to 8608 lines of
.s file.  The stack frame in huft_build shrinks from 1644->1628 bytes,
inflate_codes shrinks from 116->108 bytes, and inflate_block from 2620->2612,
due to fewer spills.

Take that alkis. :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19639 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 17:55:19 +00:00
autoconf Fix llvm-java project autconfiguration. 2005-01-16 09:44:58 +00:00
docs Fix typos noticed by Gabor Greif, thanks Gabor! 2005-01-17 00:12:04 +00:00
examples Use LLVMLIBS=JIT to get JIT libraries 2004-11-29 07:17:18 +00:00
include/llvm Make methods private, add a method. 2005-01-17 17:14:43 +00:00
lib Implement a target independent optimization to codegen arguments only into 2005-01-17 17:55:19 +00:00
projects Update per new Makefile requirements for projects 2005-01-16 02:21:42 +00:00
runtime Turn on LOADABLE_MODULE so that profile.so can be loaded dynamically by 2005-01-13 16:53:05 +00:00
test New testcase for a problem that occurred in 132.ijpeg 2005-01-17 06:25:59 +00:00
tools sysconfdir -> PROJ_etcdir 2005-01-17 00:42:31 +00:00
utils Fix the path from ../lib/Debug to ../Debug/lib per changes to Makefiles. 2005-01-14 16:32:39 +00:00
win32 Add some .cvsignores to the win32 hierarchy to account for generated files 2005-01-16 03:18:23 +00:00
.cvsignore Ignore the autom4te.cache directoy. 2004-12-24 15:11:23 +00:00
configure Fix llvm-java project autconfiguration. 2005-01-16 09:44:58 +00:00
CREDITS.TXT Add MMC 2004-11-18 21:04:21 +00:00
LICENSE.TXT Another year, another copyright update. 2005-01-08 19:10:44 +00:00
llvm.spec Updated for 1.3. 2004-08-16 15:17:40 +00:00
llvm.spec.in Updated for 1.3. 2004-08-16 15:17:40 +00:00
Makefile Remove the check target. Its now in Makefile.rules 2004-12-06 05:35:00 +00:00
Makefile.common Make this file capable of being used by both LLVM and its projects 2005-01-16 02:20:30 +00:00
Makefile.config.in Don't confuse the LLVM_OBJ_DIR and the PROJ_OBJ_DIR because there might be 2005-01-16 06:53:48 +00:00
Makefile.rules Several changes: 2005-01-16 02:20:54 +00:00
README.txt Make the text of this file a little more useful. 2004-09-02 22:49:27 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level 
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments. 

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.