mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-16 00:18:06 +00:00
5707dd7f73
--- Reverse-merging r75799 into '.': U test/Analysis/PointerTracking U include/llvm/Target/TargetMachineRegistry.h U include/llvm/Target/TargetMachine.h U include/llvm/Target/TargetRegistry.h U include/llvm/Target/TargetSelect.h U tools/lto/LTOCodeGenerator.cpp U tools/lto/LTOModule.cpp U tools/llc/llc.cpp U lib/Target/PowerPC/PPCTargetMachine.h U lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp U lib/Target/PowerPC/PPCTargetMachine.cpp U lib/Target/PowerPC/PPC.h U lib/Target/ARM/ARMTargetMachine.cpp U lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp U lib/Target/ARM/ARMTargetMachine.h U lib/Target/ARM/ARM.h U lib/Target/XCore/XCoreTargetMachine.cpp U lib/Target/XCore/XCoreTargetMachine.h U lib/Target/PIC16/PIC16TargetMachine.cpp U lib/Target/PIC16/PIC16TargetMachine.h U lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp U lib/Target/Alpha/AlphaTargetMachine.cpp U lib/Target/Alpha/AlphaTargetMachine.h U lib/Target/X86/X86TargetMachine.h U lib/Target/X86/X86.h U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h U lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h U lib/Target/X86/X86TargetMachine.cpp U lib/Target/MSP430/MSP430TargetMachine.cpp U lib/Target/MSP430/MSP430TargetMachine.h U lib/Target/CppBackend/CPPTargetMachine.h U lib/Target/CppBackend/CPPBackend.cpp U lib/Target/CBackend/CTargetMachine.h U lib/Target/CBackend/CBackend.cpp U lib/Target/TargetMachine.cpp U lib/Target/IA64/IA64TargetMachine.cpp U lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp U lib/Target/IA64/IA64TargetMachine.h U lib/Target/IA64/IA64.h U lib/Target/MSIL/MSILWriter.cpp U lib/Target/CellSPU/SPUTargetMachine.h U lib/Target/CellSPU/SPU.h U lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp U lib/Target/CellSPU/SPUTargetMachine.cpp U lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp U lib/Target/Mips/MipsTargetMachine.cpp U lib/Target/Mips/MipsTargetMachine.h U lib/Target/Mips/Mips.h U lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp U lib/Target/Sparc/SparcTargetMachine.cpp U lib/Target/Sparc/SparcTargetMachine.h U lib/ExecutionEngine/JIT/TargetSelect.cpp U lib/Support/TargetRegistry.cpp llvm-svn: 75820
89 lines
2.7 KiB
C++
89 lines
2.7 KiB
C++
//===-- SPUTargetMachine.cpp - Define TargetMachine for Cell SPU ----------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Top-level implementation for the Cell SPU target.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "SPU.h"
|
|
#include "SPURegisterNames.h"
|
|
#include "SPUTargetAsmInfo.h"
|
|
#include "SPUTargetMachine.h"
|
|
#include "llvm/Module.h"
|
|
#include "llvm/PassManager.h"
|
|
#include "llvm/Target/TargetMachineRegistry.h"
|
|
#include "llvm/CodeGen/RegAllocRegistry.h"
|
|
#include "llvm/CodeGen/SchedulerRegistry.h"
|
|
|
|
using namespace llvm;
|
|
|
|
extern Target TheCellSPUTarget;
|
|
namespace {
|
|
// Register the targets
|
|
RegisterTarget<SPUTargetMachine>
|
|
CELLSPU(TheCellSPUTarget, "cellspu", "STI CBEA Cell SPU [experimental]");
|
|
}
|
|
|
|
// No assembler printer by default
|
|
SPUTargetMachine::AsmPrinterCtorFn SPUTargetMachine::AsmPrinterCtor = 0;
|
|
|
|
// Force static initialization.
|
|
extern "C" void LLVMInitializeCellSPUTarget() { }
|
|
|
|
const std::pair<unsigned, int> *
|
|
SPUFrameInfo::getCalleeSaveSpillSlots(unsigned &NumEntries) const {
|
|
NumEntries = 1;
|
|
return &LR[0];
|
|
}
|
|
|
|
const TargetAsmInfo *
|
|
SPUTargetMachine::createTargetAsmInfo() const
|
|
{
|
|
return new SPULinuxTargetAsmInfo(*this);
|
|
}
|
|
|
|
SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M,
|
|
const std::string &FS)
|
|
: LLVMTargetMachine(T),
|
|
Subtarget(*this, M, FS),
|
|
DataLayout(Subtarget.getTargetDataString()),
|
|
InstrInfo(*this),
|
|
FrameInfo(*this),
|
|
TLInfo(*this),
|
|
InstrItins(Subtarget.getInstrItineraryData())
|
|
{
|
|
// For the time being, use static relocations, since there's really no
|
|
// support for PIC yet.
|
|
setRelocationModel(Reloc::Static);
|
|
}
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Pass Pipeline Configuration
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
bool
|
|
SPUTargetMachine::addInstSelector(PassManagerBase &PM,
|
|
CodeGenOpt::Level OptLevel)
|
|
{
|
|
// Install an instruction selector.
|
|
PM.add(createSPUISelDag(*this));
|
|
return false;
|
|
}
|
|
|
|
bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
|
|
CodeGenOpt::Level OptLevel,
|
|
bool Verbose,
|
|
formatted_raw_ostream &Out) {
|
|
// Output assembly language.
|
|
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
|
if (AsmPrinterCtor)
|
|
PM.add(AsmPrinterCtor(Out, *this, Verbose));
|
|
return false;
|
|
}
|