llvm-6502/test/CodeGen
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
..
Alpha Fix PR2590 by making PatternSortingPredicate actually be 2010-03-01 22:09:11 +00:00
ARM pr6478: The frame pointer spill frame index is only defined when there is a 2010-03-04 21:42:36 +00:00
Blackfin Change the scheduler from adding nodes in allnodes order 2010-02-24 06:11:37 +00:00
CBackend Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
CellSPU don't let asm-verbose break the check-next lines in these tests. 2010-01-19 06:39:54 +00:00
CPP fix PR5295 where the .ll parser didn't reject a function after a global 2009-10-25 23:22:50 +00:00
Generic stop using anders-aa 2010-03-01 20:24:05 +00:00
MBlaze Adding the MicroBlaze backend. 2010-02-23 19:15:24 +00:00
Mips Delete useless trailing semicolons. 2010-01-05 17:55:26 +00:00
MSP430 Fix some issues in WalkChainUsers dealing with 2010-03-02 22:20:06 +00:00
PIC16 this testcase is failing because pic16 doesn't define a reg/reg 2010-03-02 20:48:24 +00:00
PowerPC add some random nounwinds. 2010-02-28 20:36:49 +00:00
SPARC add support for the sparcv9-*-* target triple to turn on 2010-02-04 06:34:01 +00:00
SystemZ Teach dag combine to fold the following transformation more aggressively: 2010-01-06 19:38:29 +00:00
Thumb Run the pre-register allocation tail duplication pass by default. Remove 2010-01-16 00:29:50 +00:00
Thumb2 Drop the ".w" qualifier for t2UXTB16* instructions as there is no 16-bit version 2010-03-04 22:24:41 +00:00
X86 Micro-optimization: 2010-03-05 00:24:26 +00:00
XCore Fix XCoreTargetLowering::isLegalAddressingMode() to handle VoidTy. 2010-02-26 16:44:51 +00:00