llvm-6502/lib
Chris Lattner b3ddfc42af add two dag combines:
(C1-X) == C2 --> X == C1-C2
(X+C1) == C2 --> X == C2-C1

This allows us to compile this:

bool %X(int %X) {
        %Y = add int %X, 14
        %Z = setne int %Y, 12345
        ret bool %Z
}

into this:

_X:
        cmpl $12331, 4(%esp)
        setne %al
        movzbl %al, %eax
        andl $1, %eax
        ret

not this:

_X:
        movl $14, %eax
        addl 4(%esp), %eax
        cmpl $12345, %eax
        setne %al
        movzbl %al, %eax
        andl $1, %eax
        ret

Testcase here: Regression/CodeGen/X86/compare-add.ll

nukage of the and coming up next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25898 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-02 06:36:13 +00:00
..
Analysis
Archive
AsmParser
Bytecode Fix auto-upgrade of intrinsics to work properly with both assembly and 2006-01-27 11:49:27 +00:00
CodeGen add two dag combines: 2006-02-02 06:36:13 +00:00
Debugger
ExecutionEngine Allow the specification of explicit alignments for constant pool entries. 2006-01-31 22:23:14 +00:00
Linker
Support dynamically allocate plugin space as needed 2006-01-26 19:38:58 +00:00
System Add AddSymbol() method to DynamicLibrary to work around Windows limitation 2006-01-30 04:33:51 +00:00
Target Update. 2006-02-02 02:40:17 +00:00
Transforms Improve compatibility with VC2005, patch by Morten Ofstad! 2006-01-26 20:41:32 +00:00
VMCore validate matching constraints and remember when we see them. 2006-02-02 00:23:53 +00:00
Makefile