llvm-6502/lib/CodeGen
Chris Lattner 68dc310942 Implement a couple of more simplifications. This lets us codegen:
int test2(int * P, int* Q, int A, int B) {
        return P+A == P;
}

into:

test2:
        movl 4(%esp), %eax
        movl 12(%esp), %eax
        shll $2, %eax
        cmpl $0, %eax
        sete %al
        movzbl %al, %eax
        ret

instead of:

test2:
        movl 4(%esp), %eax
        movl 12(%esp), %ecx
        leal (%eax,%ecx,4), %ecx
        cmpl %eax, %ecx
        sete %al
        movzbl %al, %eax
        ret

ICC is producing worse code:

test2:
        movl      4(%esp), %eax                                 #8.5
        movl      12(%esp), %edx                                #8.5
        lea       (%edx,%edx), %ecx                             #9.9
        addl      %ecx, %ecx                                    #9.9
        addl      %eax, %ecx                                    #9.9
        cmpl      %eax, %ecx                                    #9.16
        movl      $0, %eax                                      #9.16
        sete      %al                                           #9.16
        ret                                                     #9.16

as is GCC (looks like our old code):

test2:
        movl    4(%esp), %edx
        movl    12(%esp), %eax
        leal    (%edx,%eax,4), %ecx
        cmpl    %edx, %ecx
        sete    %al
        movzbl  %al, %eax
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19430 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-10 02:03:02 +00:00
..
SelectionDAG Implement a couple of more simplifications. This lets us codegen: 2005-01-10 02:03:02 +00:00
AsmPrinter.cpp Silence VS warnings 2005-01-08 19:59:10 +00:00
BranchFolding.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
IntrinsicLowering.cpp Fix #includes of i*.h => Instructions.h as per PR403. 2004-07-29 17:30:56 +00:00
LiveInterval.cpp Prevent accessing past the end of the intervals vector, this fixes 2004-12-04 01:22:09 +00:00
LiveInterval.h Fix typeo 2004-11-18 04:31:10 +00:00
LiveIntervalAnalysis.cpp Silence warnings from VS 2005-01-08 19:55:00 +00:00
LiveIntervalAnalysis.h For PR387:\ 2004-12-07 04:03:45 +00:00
LiveVariables.cpp Do not use variable sized arrays in C++, they are non-portable. Patch 2004-10-25 18:44:14 +00:00
MachineBasicBlock.cpp Move method bodies that depend on <algorithm> from MBB.h to MBB.cpp 2004-10-26 15:43:42 +00:00
MachineCodeEmitter.cpp Fix the FIXME, nuke the JIT specific forceCompilationOf method. 2004-11-22 21:54:35 +00:00
MachineFunction.cpp Silence warnings from VS 2005-01-08 19:55:00 +00:00
MachineInstr.cpp Allow machine operands to represent global variables with offsets. This is 2004-10-15 04:38:41 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
Passes.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
PHIElimination.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
PhysRegTracker.h Improved PhysRegTracker interface. RegAlloc lazily allocates the register tracker using a std::auto_ptr 2004-02-23 06:10:13 +00:00
PrologEpilogInserter.cpp Put this change back in after testing from Reid proved its innocence. getSpillSize now returns value in bits 2004-08-29 22:00:24 +00:00
RegAllocIterativeScan.cpp Silence VS warnings 2005-01-08 19:53:50 +00:00
RegAllocLinearScan.cpp Silence VS warnings 2005-01-08 19:53:50 +00:00
RegAllocLocal.cpp Clean up the MachineBasicBlock.h file, percolating #includes into this file. 2004-10-26 15:35:58 +00:00
RegAllocSimple.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
TwoAddressInstructionPass.cpp Make the 2-address instruction lowering pass smarter in two ways: 2005-01-02 02:34:12 +00:00
UnreachableBlockElim.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
VirtRegMap.cpp Clean up the MachineBasicBlock.h file, percolating #includes into this file. 2004-10-26 15:35:58 +00:00
VirtRegMap.h When a virtual register is folded into an instruction, keep track of whether 2004-10-01 23:15:36 +00:00