llvm-6502/lib/Target/CellSPU
Dan Gohman 6520e20e4f Teach DAGCombine to fold constant offsets into GlobalAddress nodes,
and add a TargetLowering hook for it to use to determine when this
is legal (i.e. not in PIC mode, etc.)

This allows instruction selection to emit folded constant offsets
in more cases, such as the included testcase, eliminating the need
for explicit arithmetic instructions.

This eliminates the need for the C++ code in X86ISelDAGToDAG.cpp
that attempted to achieve the same effect, but wasn't as effective.

Also, fix handling of offsets in GlobalAddressSDNodes in several
places, including changing GlobalAddressSDNode's offset from
int to int64_t.

The Mips, Alpha, Sparc, and CellSPU targets appear to be
unaware of GlobalAddress offsets currently, so set the hook to
false on those targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18 02:06:02 +00:00
..
CellSDKIntrinsics.td Merge current work back to tree to minimize diffs and drift. Major highlights 2008-02-23 18:41:37 +00:00
CMakeLists.txt CMake: Builds all targets. 2008-09-26 04:40:32 +00:00
Makefile More cleanups for CellSPU: 2008-01-30 02:55:46 +00:00
README.txt More cleanups for CellSPU: 2008-01-30 02:55:46 +00:00
SPU.h Use template to distinguish between function variants. 2008-10-08 07:44:52 +00:00
SPU.td Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUAsmPrinter.cpp Switch the MachineOperand accessors back to the short names like 2008-10-03 15:45:36 +00:00
SPUCallingConv.td Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUFrameInfo.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUFrameInfo.h Bug fixes and updates for CellSPU, syncing up with trunk. Most notable 2008-04-30 00:30:08 +00:00
SPUHazardRecognizers.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUHazardRecognizers.h Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUInstrBuilder.h Fix constant pool loads, and remove broken versions of addConstantPoolReference. 2008-09-06 01:11:01 +00:00
SPUInstrFormats.td Merge current work back to tree to minimize diffs and drift. Major highlights 2008-02-23 18:41:37 +00:00
SPUInstrInfo.cpp Const-ify several TargetInstrInfo methods. 2008-10-16 01:49:15 +00:00
SPUInstrInfo.h Const-ify several TargetInstrInfo methods. 2008-10-16 01:49:15 +00:00
SPUInstrInfo.td Change CALLSEQ_BEGIN and CALLSEQ_END to take TargetConstant's as 2008-10-11 22:08:30 +00:00
SPUISelDAGToDAG.cpp Trim #includes. 2008-10-16 20:18:31 +00:00
SPUISelLowering.cpp Teach DAGCombine to fold constant offsets into GlobalAddress nodes, 2008-10-18 02:06:02 +00:00
SPUISelLowering.h Teach DAGCombine to fold constant offsets into GlobalAddress nodes, 2008-10-18 02:06:02 +00:00
SPUMachineFunction.h Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUNodes.td Add necessary 64-bit support so that gcc frontend compiles (mostly). Current 2008-06-02 22:18:03 +00:00
SPUOperands.td Rename ConstantSDNode's getSignExtended to getSExtValue, for 2008-09-26 21:54:37 +00:00
SPURegisterInfo.cpp Switch the MachineOperand accessors back to the short names like 2008-10-03 15:45:36 +00:00
SPURegisterInfo.h Move reMaterialize() from TargetRegisterInfo to TargetInstrInfo. 2008-03-31 20:40:39 +00:00
SPURegisterInfo.td Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPURegisterNames.h Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUSchedule.td Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUSubtarget.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUSubtarget.h Rewrite tblgen handling of subtarget features so 2008-02-14 23:35:16 +00:00
SPUTargetAsmInfo.cpp Get rid of now unused {Four,Eight,Sixteen}ByteConstantSection 2008-09-24 22:18:54 +00:00
SPUTargetAsmInfo.h Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SPUTargetMachine.cpp mark some targets as experimental. Andrew, if you think that Alpha is 2008-10-16 06:16:50 +00:00
SPUTargetMachine.h Use raw_ostream throughout the AsmPrinter. 2008-08-21 00:14:44 +00:00

//===- README.txt - Notes for improving CellSPU-specific code gen ---------===//

This code was contributed by a team from the Computer Systems Research
Department in The Aerospace Corporation:

- Scott Michel (head bottle washer and much of the non-floating point
  instructions)
- Mark Thomas (floating point instructions)
- Michael AuYeung (intrinsics)
- Chandler Carruth (LLVM expertise)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR
OTHERWISE.  IN NO EVENT SHALL THE AEROSPACE CORPORATION BE LIABLE FOR DAMAGES
OF ANY KIND OR NATURE WHETHER BASED IN CONTRACT, TORT, OR OTHERWISE ARISING
OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE INCLUDING, WITHOUT
LIMITATION, DAMAGES RESULTING FROM LOST OR CONTAMINATED DATA, LOST PROFITS OR
REVENUE, COMPUTER MALFUNCTION, OR FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL,
OR PUNITIVE  DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR
SUCH DAMAGES ARE FORESEEABLE. 

---------------------------------------------------------------------------
--WARNING--:
--WARNING--: The CellSPU work is work-in-progress and "alpha" quality code.
--WARNING--:

If you are brave enough to try this code or help to hack on it, be sure
to add 'spu' to configure's --enable-targets option, e.g.:

        ./configure <your_configure_flags_here> \
           --enable-targets=x86,x86_64,powerpc,spu

---------------------------------------------------------------------------

TODO:
* Finish branch instructions, branch prediction

  These instructions were started, but only insofar as to get llvm-gcc-4.2's
  crtbegin.ll working (which doesn't.)

* Double floating point support

  This was started. "What's missing?" to be filled in.

* Intrinsics

  Lots of progress. "What's missing/incomplete?" to be filled in.

===-------------------------------------------------------------------------===