llvm-6502/lib/Target/PowerPC
Nate Begeman 2a05c8e260 Fold constant adds into loads and stores to frame indices.
For the following code:
double %ext(int %A.0__, long %A.1__) {
        %A_addr = alloca %typedef.DComplex              ; <%typedef.DComplex*> [#uses=2]
        %tmp.1 = cast %typedef.DComplex* %A_addr to int*                ; <int*> [#uses=1]
        store int %A.0__, int* %tmp.1
        %tmp.2 = getelementptr %typedef.DComplex* %A_addr, int 0, uint 1                ; <double*> [#uses=2]
        %tmp.3 = cast double* %tmp.2 to long*           ; <long*> [#uses=1]
        store long %A.1__, long* %tmp.3
        %tmp.5 = load double* %tmp.2            ; <double> [#uses=1]
        ret double %tmp.5
}

We now generate:
_ext:
.LBB_ext_0:     ;
        stw r3, -12(r1)
        stw r4, -8(r1)
        stw r5, -4(r1)
        lfd f1, -8(r1)
        blr

Instead of:
_ext:
.LBB_ext_0:     ;
        stw r3, -12(r1)
        addi r2, r1, -12
        stw r4, 4(r2)
        stw r5, 8(r2)
        lfd f1, 4(r2)
        blr

This also fires hundreds of times on MultiSource.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22533 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-28 03:02:05 +00:00
..
.cvsignore ignore generated files. 2004-11-21 00:00:54 +00:00
LICENSE.TXT Added Louis Gerbarg. Louis is given credit in the CREDITS.TXT file, so I 2004-08-05 23:46:27 +00:00
Makefile Specify all of the targets built. 2004-12-16 17:26:44 +00:00
PowerPC.td Factor out common .td file chunks. 2004-12-16 16:31:57 +00:00
PowerPCInstrInfo.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PowerPCTargetMachine.h Refactor the addPassesToEmitAssembly interface into a addPassesToEmitFile 2005-06-25 02:48:37 +00:00
PPC32.td Factor out common .td file chunks. 2004-12-16 16:31:57 +00:00
PPC32ISelSimple.cpp Support building non-PIC 2005-07-21 20:44:43 +00:00
PPC32JITInfo.h update interface 2005-07-22 20:49:37 +00:00
PPC32RegisterInfo.td Initial support for allocation condition registers 2005-04-12 07:04:16 +00:00
PPC64.td Factor out common .td file chunks. 2004-12-16 16:31:57 +00:00
PPC64CodeEmitter.cpp Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPC64InstrInfo.cpp Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPC64InstrInfo.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPC64ISelPattern.cpp Support building non-PIC 2005-07-21 20:44:43 +00:00
PPC64JITInfo.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPC64RegisterInfo.cpp Convert tabs to spaces 2005-04-22 17:54:37 +00:00
PPC64RegisterInfo.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPC64RegisterInfo.td Switch from bytes to bits for alignment. 2004-08-21 20:14:40 +00:00
PPC64TargetMachine.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPC.h Support building non-PIC 2005-07-21 20:44:43 +00:00
PPCAsmPrinter.cpp Wrap some long lines, fix emission of weak global variables 2005-07-26 19:03:27 +00:00
PPCBranchSelector.cpp Eliminate all remaining tabs and trailing spaces. 2005-07-27 06:12:32 +00:00
PPCCodeEmitter.cpp Eliminate all remaining tabs and trailing spaces. 2005-07-27 06:12:32 +00:00
PPCFrameInfo.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPCInstrBuilder.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPCInstrFormats.td switch over the rest of the formats that use RC to use isDOT 2005-04-19 05:21:30 +00:00
PPCInstrInfo.cpp Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPCInstrInfo.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPCInstrInfo.td Support building non-PIC 2005-07-21 20:44:43 +00:00
PPCISelPattern.cpp Fold constant adds into loads and stores to frame indices. 2005-07-28 03:02:05 +00:00
PPCJITInfo.cpp update interface 2005-07-22 20:49:37 +00:00
PPCJITInfo.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPCRegisterInfo.cpp Fix some comments 2005-07-27 23:11:27 +00:00
PPCRegisterInfo.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
PPCRegisterInfo.td Revamp the Register class, and allow the use of the RegisterGroup class to 2004-09-14 04:17:02 +00:00
PPCRelocations.h Eliminate tabs and trailing spaces. 2005-07-27 05:53:44 +00:00
PPCTargetMachine.cpp Eliminate all remaining tabs and trailing spaces. 2005-07-27 06:12:32 +00:00
PPCTargetMachine.h Remove trailing whitespace 2005-04-21 23:30:14 +00:00
README.txt Implement the optimization for the Red Zone on Darwin. This removes the 2005-07-27 06:06:29 +00:00

TODO:
* gpr0 allocation
* implement do-loop -> bdnz transform
* implement powerpc-64 for darwin
* use stfiwx in float->int
* be able to combine sequences like the following into 2 instructions:
	lis r2, ha16(l2__ZTV4Cell)
	la r2, lo16(l2__ZTV4Cell)(r2)
	addi r2, r2, 8

* should hint to the branch select pass that it doesn't need to print the
  second unconditional branch, so we don't end up with things like:
	b .LBBl42__2E_expand_function_8_674	; loopentry.24
	b .LBBl42__2E_expand_function_8_42	; NewDefault
	b .LBBl42__2E_expand_function_8_42	; NewDefault