1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/lib
Chris Lattner c686a9ab37 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!

llvm-svn: 12026
2004-03-01 02:34:08 +00:00
..
Analysis Only clone global nodes between graphs if both graphs have the global. 2004-02-27 20:05: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 This debugging hook is no longer needed. 2004-02-09 17:20:52 +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
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