llvm-6502/test
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 remove andersen's tests. 2010-03-01 20:23:15 +00:00
Archive
Assembler Add support for a union type in LLVM IR. Patch by Talin! 2010-02-12 20:49:41 +00:00
Bindings/Ocaml Expose the rest of the llvm-c scalar opts to ocaml. 2010-03-03 23:51:34 +00:00
Bitcode
BugPoint
CodeGen Micro-optimization: 2010-03-05 00:24:26 +00:00
DebugInfo Remove test to check bugfix in handing debug info for global variables using intrinsics. Now, debug info for global variable is encoded using metadata. The old code path is now history and there is no need to have a test to check a bug fix in old code path. 2010-03-01 19:09:55 +00:00
ExecutionEngine Floating-point add, sub, and mul are now spelled fadd, fsub, and fmul, 2010-03-02 01:11:08 +00:00
Feature Add support for a union type in LLVM IR. Patch by Talin! 2010-02-12 20:49:41 +00:00
FrontendAda
FrontendC Eliminate llvmgcc_version testing variable. 2010-02-23 07:56:28 +00:00
FrontendC++ Ignore target dependent value in grep search. 2010-02-18 19:52:12 +00:00
FrontendFortran
FrontendObjC new test case for r96974. 2010-02-23 19:37:40 +00:00
FrontendObjC++
Integer
lib Eliminate llvmgcc_version testing variable. 2010-02-23 07:56:28 +00:00
Linker
LLVMC Update the test suite. 2010-02-23 09:04:51 +00:00
MC This is a patch to the assembler frontend to detect when aligning a text 2010-02-25 18:46:04 +00:00
Other stop using anders-aa 2010-03-01 20:24:50 +00:00
Scripts
TableGen
Transforms Make the 'icmp pred trunc(ext(X)), CST --> icmp pred X, ext(trunc(CST))' 2010-03-04 06:54:10 +00:00
Unit Try r96559 for the third time. This time the shared library is only built if 2010-02-25 06:34:33 +00:00
Verifier
CMakeLists.txt
lit.cfg Teach lit to honor conditional directives. The syntax is: 2010-03-04 09:36:50 +00:00
lit.site.cfg.in
Makefile Try r96559 for the third time. This time the shared library is only built if 2010-02-25 06:34:33 +00:00
Makefile.tests Switch .bc/.ll Makefile rules to use LLVM{CC,CXX} instead of LLVMG{CC,XX} 2010-02-23 10:28:06 +00:00
site.exp.in Eliminate llvmgcc_version testing variable. 2010-02-23 07:56:28 +00:00
TestRunner.sh