llvm-6502/lib
Chris Lattner ce6096f49b Fix a minor code-quality issue. When passing 8 and 16-bit integer constants
to function calls, we would emit dead code, like this:

int Y(int, short, double);
int X() {
  Y(4, 123, 4);
}

--- Old
X:
        sub %ESP, 20
        mov %EAX, 4
        mov DWORD PTR [%ESP], %EAX
***     mov %AX, 123
        mov %AX, 123
        movsx %EAX, %AX
        mov DWORD PTR [%ESP + 4], %EAX
        fld QWORD PTR [.CPIX_0]
        fstp QWORD PTR [%ESP + 8]
        call Y
        mov %EAX, 0
        # IMPLICIT_USE %EAX %ESP
        add %ESP, 20
        ret

Now we emit:
X:
        sub %ESP, 20
        mov %EAX, 4
        mov DWORD PTR [%ESP], %EAX
        mov %AX, 123
        movsx %EAX, %AX
        mov DWORD PTR [%ESP + 4], %EAX
        fld QWORD PTR [.CPIX_0]
        fstp QWORD PTR [%ESP + 8]
        call Y
        mov %EAX, 0
        # IMPLICIT_USE %EAX %ESP
        add %ESP, 20
        ret

Next up, eliminate the mov AX and movsx entirely!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12026 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-01 02:34:08 +00:00
..
Analysis * Remove function to find "main" in a Module, there's a method for that 2004-02-29 23:09:10 +00:00
Archive * finegrainify namespacification of ArchiveReader.cpp 2004-01-10 19:00:15 +00:00
AsmParser It turns out that the two dimensional vectors were causing big slowdowns 2004-02-09 21:03:38 +00:00
Bytecode Adjustments to support the new ConstantAggregateZero class 2004-02-15 05:55:15 +00:00
CodeGen Add an assert 2004-02-29 22:01:51 +00:00
Debugger "fix" a nasty race condition 2004-01-14 21:18:03 +00:00
ExecutionEngine remove obsolete comment 2004-02-26 07:59:22 +00:00
Linker Include Config/config.h for SHLIBEXT. 2004-02-23 22:42:51 +00:00
Support Make sure that at least one virtual method is defined in a .cpp file to avoid 2004-02-26 07:24:18 +00:00
Target Fix a minor code-quality issue. When passing 8 and 16-bit integer constants 2004-03-01 02:34:08 +00:00
Transforms Disable tail duplication in a case that breaks on Olden/tsp 2004-03-01 01:12:13 +00:00
VMCore Fix -debug-pass=Executions, which relied on Function, Module, and BasicBlock 2004-02-29 22:37:04 +00:00
Makefile CBackend is no longer here 2004-02-13 23:29:37 +00:00