llvm-6502/lib
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
..
Analysis Silence VC++ warnings. 2005-01-12 04:51:37 +00:00
Archive Remove potential platform portability issue with size of "int". 2004-12-29 01:20:24 +00:00
AsmParser Silence VS warnings. 2005-01-08 20:07:03 +00:00
Bytecode Remove potential platform portability issue with size of "int". 2004-12-29 01:20:24 +00:00
CodeGen Implement a target independent optimization to codegen arguments only into 2005-01-17 17:55:19 +00:00
Debugger Correct the comments and file header. 2004-12-23 21:16:46 +00:00
ExecutionEngine Improve compatiblity with HPUX on Itanium, patch by Duraid Madina 2005-01-16 01:31:31 +00:00
Linker Remove un-needed #includes. 2004-12-20 04:15:44 +00:00
Support Use size_t instead of long to represent memory usage. long is 32 bits 2005-01-08 20:15:57 +00:00
System Fix bugpoint 2005-01-16 04:23:22 +00:00
Target Fix a major regression last night that prevented us from producing [mem] op= reg 2005-01-17 17:49:14 +00:00
Transforms Delete PHI nodes that are not dead but are locked in a cycle of single 2005-01-17 05:10:15 +00:00
VMCore implement these methods. 2005-01-15 06:52:40 +00:00
Makefile Add the Linker library 2004-11-14 21:54:41 +00:00