llvm-6502/lib
Bill Wendling 37b52ee6d9 Micro-optimization:
This code:

float floatingPointComparison(float x, float y) {
    double product = (double)x * y;
    if (product == 0.0)
        return product;
    return product - 1.0;
}

produces this:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jne             0x00000004
0000000000000016        jp              0x00000002
0000000000000018        jmp             0x00000008
000000000000001a        addsd           0x00000006(%rip),%xmm0
0000000000000022        cvtsd2ss        %xmm0,%xmm0
0000000000000026        ret

The "jne/jp/jmp" sequence can be reduced to this instead:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jp              0x00000002
0000000000000016        je              0x00000008
0000000000000018        addsd           0x00000006(%rip),%xmm0
0000000000000020        cvtsd2ss        %xmm0,%xmm0
0000000000000024        ret

for a savings of 2 bytes.

This xform can happen when we recognize that jne and jp jump to the same "true"
MBB, the unconditional jump would jump to the "false" MBB, and the "true" branch
is the fall-through MBB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 00:24:26 +00:00
..
Analysis fix incorrect folding of icmp with undef, PR6481. 2010-03-03 19:46:03 +00:00
Archive From PR6228: 2010-02-04 06:19:43 +00:00
AsmParser Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some 2010-02-16 14:50:09 +00:00
Bitcode Add Module functions in place of module providers. 2010-03-02 23:58:54 +00:00
CodeGen Fix some more places where dbg_value affected codegen. 2010-03-05 00:02:59 +00:00
CompilerDriver Input files with empty suffixes must be passed to linker. 2010-02-23 09:05:21 +00:00
ExecutionEngine Fix PR6360. It's easy for a stub's address to escape to user code, so we can't 2010-03-04 19:45:09 +00:00
Linker Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some 2010-02-16 14:50:09 +00:00
MC pass in more section kinds, enough to get the .align 0x90 2010-02-26 18:32:26 +00:00
Support Don't potentially read past the end of the fill data when making a NaN from 2010-03-01 18:38:45 +00:00
System follow-on to PR6280 2010-02-14 18:20:09 +00:00
Target Micro-optimization: 2010-03-05 00:24:26 +00:00
Transforms Make SCEVExpander and LSR more aggressive about hoisting expressions out 2010-03-03 05:29:13 +00:00
VMCore Stop leaking MDStrings. 2010-03-04 23:24:19 +00:00
Makefile remove llvm-db: it is completely broken and if anyone wants to do a debugger, 2009-10-05 02:29:51 +00:00