1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
llvm-mirror/lib
Chris Lattner 9c400f3b28 Revamp long/ulong comparisons to use a much more efficient sequence (thanks
to Brian and the Sun compiler for pointing out that the obvious works :)

This also enables folding all long comparisons into setcc and branch
instructions: before we could only do == and !=

For example, for:
void test(unsigned long long A, unsigned long long B) {
   if (A < B) foo();
 }

We now generate:

test:
        subl $4, %esp
        movl %esi, (%esp)
        movl 8(%esp), %eax
        movl 12(%esp), %ecx
        movl 16(%esp), %edx
        movl 20(%esp), %esi
        subl %edx, %eax
        sbbl %esi, %ecx
        jae .LBBtest_2  # UnifiedReturnBlock
.LBBtest_1:     # then
        call foo
        movl (%esp), %esi
        addl $4, %esp
        ret
.LBBtest_2:     # UnifiedReturnBlock
        movl (%esp), %esi
        addl $4, %esp
        ret

Instead of:

test:
        subl $12, %esp
        movl %esi, 8(%esp)
        movl %ebx, 4(%esp)
        movl 16(%esp), %eax
        movl 20(%esp), %ecx
        movl 24(%esp), %edx
        movl 28(%esp), %esi
        cmpl %edx, %eax
        setb %al
        cmpl %esi, %ecx
        setb %bl
        cmove %ax, %bx
        testb %bl, %bl
        je .LBBtest_2   # UnifiedReturnBlock
.LBBtest_1:     # then
        call foo
        movl 4(%esp), %ebx
        movl 8(%esp), %esi
        addl $12, %esp
        ret
.LBBtest_2:     # UnifiedReturnBlock
        movl 4(%esp), %ebx
        movl 8(%esp), %esi
        addl $12, %esp
        ret

llvm-svn: 18330
2004-11-29 05:55:24 +00:00
..
Analysis Fix DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll 2004-11-28 20:30:15 +00:00
AsmParser Fix PR463 2004-11-28 16:45:45 +00:00
Bytecode Compute the firstFileOffset correctly after reading the LLVM symbol table. 2004-11-28 03:13:02 +00:00
CodeGen Fix SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c, and hopefully 2004-11-28 17:56:47 +00:00
Debugger Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
ExecutionEngine Rename Emitter.cpp -> JITEmitter.cpp 2004-11-22 22:00:25 +00:00
Linker Implement dependent library linking. It is no longer required that -lstdc++ 2004-11-25 09:32:08 +00:00
Support Add bzip2 subdirectory 2004-11-25 19:38:28 +00:00
System Cast the void* handle data member to HMODULE* to keep the VC++ compiler 2004-11-20 23:30:55 +00:00
Target Revamp long/ulong comparisons to use a much more efficient sequence (thanks 2004-11-29 05:55:24 +00:00
Transforms Fix for PR454: 2004-11-28 21:31:15 +00:00
VMCore Fix test/Regression/CFrontend/2003-11-01-EmptyStructCrash.c 2004-11-22 19:15:27 +00:00
Makefile Add the Linker library 2004-11-14 21:54:41 +00:00