diff options
author | Dan Gohman <gohman@apple.com> | 2011-10-25 00:05:42 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2011-10-25 00:05:42 +0000 |
commit | 3e6157de576e349d33a9b08d103405b3a8fb9159 (patch) | |
tree | e052c80458eed89e821b001205b9401a66b754bc /lib | |
parent | 29074ccf6cb00a3cbe32a3b7809d970ecaf8c9bf (diff) |
Remove the Blackfin backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
38 files changed, 0 insertions, 4422 deletions
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index 2554d64121..6e252a5899 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -20,7 +20,6 @@ const char *Triple::getArchTypeName(ArchType Kind) { case alpha: return "alpha"; case arm: return "arm"; - case bfin: return "bfin"; case cellspu: return "cellspu"; case mips: return "mips"; case mipsel: return "mipsel"; @@ -56,8 +55,6 @@ const char *Triple::getArchTypePrefix(ArchType Kind) { case arm: case thumb: return "arm"; - case bfin: return "bfin"; - case cellspu: return "spu"; case ppc64: @@ -138,8 +135,6 @@ Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) { return alpha; if (Name == "arm") return arm; - if (Name == "bfin") - return bfin; if (Name == "cellspu") return cellspu; if (Name == "mips") @@ -278,8 +273,6 @@ Triple::ArchType Triple::ParseArch(StringRef ArchName) { return x86; else if (ArchName == "amd64" || ArchName == "x86_64") return x86_64; - else if (ArchName == "bfin") - return bfin; else if (ArchName == "powerpc") return ppc; else if ((ArchName == "powerpc64") || (ArchName == "ppu")) diff --git a/lib/Target/Blackfin/Blackfin.h b/lib/Target/Blackfin/Blackfin.h deleted file mode 100644 index a00ff4cc32..0000000000 --- a/lib/Target/Blackfin/Blackfin.h +++ /dev/null @@ -1,31 +0,0 @@ -//=== Blackfin.h - Top-level interface for Blackfin backend -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the entry points for global functions defined in the LLVM -// Blackfin back-end. -// -//===----------------------------------------------------------------------===// - -#ifndef TARGET_BLACKFIN_H -#define TARGET_BLACKFIN_H - -#include "MCTargetDesc/BlackfinMCTargetDesc.h" -#include "llvm/Target/TargetMachine.h" - -namespace llvm { - - class FunctionPass; - class BlackfinTargetMachine; - - FunctionPass *createBlackfinISelDag(BlackfinTargetMachine &TM, - CodeGenOpt::Level OptLevel); - -} // end namespace llvm - -#endif diff --git a/lib/Target/Blackfin/Blackfin.td b/lib/Target/Blackfin/Blackfin.td deleted file mode 100644 index cd90962a95..0000000000 --- a/lib/Target/Blackfin/Blackfin.td +++ /dev/null @@ -1,202 +0,0 @@ -//===- Blackfin.td - Describe the Blackfin Target Machine --*- tablegen -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// -//===----------------------------------------------------------------------===// - -//===----------------------------------------------------------------------===// -// Target-independent interfaces which we are implementing -//===----------------------------------------------------------------------===// - -include "llvm/Target/Target.td" - -//===----------------------------------------------------------------------===// -// Blackfin Subtarget features. -//===----------------------------------------------------------------------===// - -def FeatureSDRAM : SubtargetFeature<"sdram", "sdram", "true", - "Build for SDRAM">; - -def FeatureICPLB : SubtargetFeature<"icplb", "icplb", "true", - "Assume instruction cache lookaside buffers are enabled at runtime">; - -//===----------------------------------------------------------------------===// -// Bugs in the silicon becomes workarounds in the compiler. -// See http://www.analog.com/ for the full list of IC anomalies. -//===----------------------------------------------------------------------===// - -def WA_MI_SHIFT : SubtargetFeature<"mi-shift-anomaly","wa_mi_shift", "true", - "Work around 05000074 - " - "Multi-Issue Instruction with dsp32shiftimm and P-reg Store">; - -def WA_CSYNC : SubtargetFeature<"csync-anomaly","wa_csync", "true", - "Work around 05000244 - " - "If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control">; - -def WA_SPECLD : SubtargetFeature<"specld-anomaly","wa_specld", "true", - "Work around 05000245 - " - "Access in the Shadow of a Conditional Branch">; - -def WA_HWLOOP : SubtargetFeature<"hwloop-anomaly","wa_hwloop", "true", - "Work around 05000257 - " - "Interrupt/Exception During Short Hardware Loop">; - -def WA_MMR_STALL : SubtargetFeature<"mmr-stall-anomaly","wa_mmr_stall", "true", - "Work around 05000283 - " - "System MMR Write Is Stalled Indefinitely when Killed">; - -def WA_LCREGS : SubtargetFeature<"lcregs-anomaly","wa_lcregs", "true", - "Work around 05000312 - " - "SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted">; - -def WA_KILLED_MMR : SubtargetFeature<"killed-mmr-anomaly", - "wa_killed_mmr", "true", - "Work around 05000315 - " - "Killed System MMR Write Completes Erroneously on Next System MMR Access">; - -def WA_RETS : SubtargetFeature<"rets-anomaly", "wa_rets", "true", - "Work around 05000371 - " - "Possible RETS Register Corruption when Subroutine Is under 5 Cycles">; - -def WA_IND_CALL : SubtargetFeature<"ind-call-anomaly", "wa_ind_call", "true", - "Work around 05000426 - " - "Speculative Fetches of Indirect-Pointer Instructions">; - -//===----------------------------------------------------------------------===// -// Register File, Calling Conv, Instruction Descriptions -//===----------------------------------------------------------------------===// - -include "BlackfinRegisterInfo.td" -include "BlackfinCallingConv.td" -include "BlackfinIntrinsics.td" -include "BlackfinInstrInfo.td" - -def BlackfinInstrInfo : InstrInfo {} - -//===----------------------------------------------------------------------===// -// Blackfin processors supported. -//===----------------------------------------------------------------------===// - -class Proc<string Name, string Suffix, list<SubtargetFeature> Features> - : Processor<!strconcat(Name, Suffix), NoItineraries, Features>; - -def : Proc<"generic", "", []>; - -multiclass Core<string Name,string Suffix, - list<SubtargetFeature> Features> { - def : Proc<Name, Suffix, Features>; - def : Proc<Name, "", Features>; - def : Proc<Name, "-none", []>; -} - -multiclass CoreEdinburgh<string Name> - : Core<Name, "-0.6", [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS]> { - def : Proc<Name, "-0.5", - [WA_MI_SHIFT, WA_SPECLD, WA_MMR_STALL, WA_LCREGS, WA_KILLED_MMR, - WA_RETS]>; - def : Proc<Name, "-0.4", - [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS, - WA_KILLED_MMR, WA_RETS]>; - def : Proc<Name, "-0.3", - [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS, - WA_KILLED_MMR, WA_RETS]>; - def : Proc<Name, "-any", - [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS, - WA_KILLED_MMR, WA_RETS]>; -} -multiclass CoreBraemar<string Name> - : Core<Name, "-0.3", - [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS, WA_RETS, WA_IND_CALL]> { - def : Proc<Name, "-0.2", - [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS, - WA_KILLED_MMR, WA_RETS, WA_IND_CALL]>; - def : Proc<Name, "-any", - [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS, - WA_KILLED_MMR, WA_RETS, WA_IND_CALL]>; -} -multiclass CoreStirling<string Name> - : Core<Name, "-0.5", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> { - def : Proc<Name, "-0.4", - [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS, WA_RETS, WA_IND_CALL]>; - def : Proc<Name, "-0.3", - [WA_MI_SHIFT, WA_SPECLD, WA_MMR_STALL, WA_LCREGS, WA_KILLED_MMR, - WA_RETS, WA_IND_CALL]>; - def : Proc<Name, "-any", - [WA_MI_SHIFT, WA_SPECLD, WA_MMR_STALL, WA_LCREGS, WA_KILLED_MMR, - WA_RETS, WA_IND_CALL]>; -} -multiclass CoreMoab<string Name> - : Core<Name, "-0.3", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> { - def : Proc<Name, "-0.2", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>; - def : Proc<Name, "-0.1", [WA_MI_SHIFT, WA_SPECLD, WA_RETS, WA_IND_CALL]>; - def : Proc<Name, "-0.0", - [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS, WA_RETS, WA_IND_CALL]>; - def : Proc<Name, "-any", - [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS, WA_RETS, WA_IND_CALL]>; -} -multiclass CoreTeton<string Name> - : Core<Name, "-0.5", - [WA_MI_SHIFT, WA_SPECLD, WA_MMR_STALL, WA_LCREGS, WA_KILLED_MMR, - WA_RETS, WA_IND_CALL]> { - def : Proc<Name, "-0.3", - [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS, - WA_KILLED_MMR, WA_RETS, WA_IND_CALL]>; - def : Proc<Name, "-any", - [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS, - WA_KILLED_MMR, WA_RETS, WA_IND_CALL]>; -} -multiclass CoreKookaburra<string Name> - : Core<Name, "-0.2", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> { - def : Proc<Name, "-0.1", [WA_MI_SHIFT, WA_SPECLD, WA_RETS, WA_IND_CALL]>; - def : Proc<Name, "-0.0", [WA_MI_SHIFT, WA_SPECLD, WA_RETS, WA_IND_CALL]>; - def : Proc<Name, "-any", [WA_MI_SHIFT, WA_SPECLD, WA_RETS, WA_IND_CALL]>; -} -multiclass CoreMockingbird<string Name> - : Core<Name, "-0.1", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> { - def : Proc<Name, "-0.0", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>; - def : Proc<Name, "-any", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>; -} -multiclass CoreBrodie<string Name> - : Core<Name, "-0.1", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> { - def : Proc<Name, "-0.0", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>; - def : Proc<Name, "-any", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>; -} - -defm BF512 : CoreBrodie<"bf512">; -defm BF514 : CoreBrodie<"bf514">; -defm BF516 : CoreBrodie<"bf516">; -defm BF518 : CoreBrodie<"bf518">; -defm BF522 : CoreMockingbird<"bf522">; -defm BF523 : CoreKookaburra<"bf523">; -defm BF524 : CoreMockingbird<"bf524">; -defm BF525 : CoreKookaburra<"bf525">; -defm BF526 : CoreMockingbird<"bf526">; -defm BF527 : CoreKookaburra<"bf527">; -defm BF531 : CoreEdinburgh<"bf531">; -defm BF532 : CoreEdinburgh<"bf532">; -defm BF533 : CoreEdinburgh<"bf533">; -defm BF534 : CoreBraemar<"bf534">; -defm BF536 : CoreBraemar<"bf536">; -defm BF537 : CoreBraemar<"bf537">; -defm BF538 : CoreStirling<"bf538">; -defm BF539 : CoreStirling<"bf539">; -defm BF542 : CoreMoab<"bf542">; -defm BF544 : CoreMoab<"bf544">; -defm BF548 : CoreMoab<"bf548">; -defm BF549 : CoreMoab<"bf549">; -defm BF561 : CoreTeton<"bf561">; - -//===----------------------------------------------------------------------===// -// Declare the target which we are implementing -//===----------------------------------------------------------------------===// - -def Blackfin : Target { - // Pull in Instruction Info: - let InstructionSet = BlackfinInstrInfo; -} diff --git a/lib/Target/Blackfin/BlackfinAsmPrinter.cpp b/lib/Target/Blackfin/BlackfinAsmPrinter.cpp deleted file mode 100644 index ed9844e1be..0000000000 --- a/lib/Target/Blackfin/BlackfinAsmPrinter.cpp +++ /dev/null @@ -1,156 +0,0 @@ -//===-- BlackfinAsmPrinter.cpp - Blackfin LLVM assembly writer ------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains a printer that converts from our internal representation -// of machine-dependent LLVM code to GAS-format BLACKFIN assembly language. -// -//===----------------------------------------------------------------------===// - -#define DEBUG_TYPE "asm-printer" -#include "Blackfin.h" -#include "BlackfinInstrInfo.h" -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Module.h" -#include "llvm/CodeGen/AsmPrinter.h" -#include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/CodeGen/MachineConstantPool.h" -#include "llvm/CodeGen/MachineInstr.h" -#include "llvm/MC/MCStreamer.h" -#include "llvm/MC/MCAsmInfo.h" -#include "llvm/MC/MCContext.h" -#include "llvm/MC/MCSymbol.h" -#include "llvm/Target/Mangler.h" -#include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetLoweringObjectFile.h" -#include "llvm/ADT/SmallString.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/TargetRegistry.h" -#include "llvm/Support/raw_ostream.h" -using namespace llvm; - -namespace { - class BlackfinAsmPrinter : public AsmPrinter { - public: - BlackfinAsmPrinter(TargetMachine &TM, MCStreamer &Streamer) - : AsmPrinter(TM, Streamer) {} - - virtual const char *getPassName() const { - return "Blackfin Assembly Printer"; - } - - void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O); - void printMemoryOperand(const MachineInstr *MI, int opNum, raw_ostream &O); - void printInstruction(const MachineInstr *MI, raw_ostream &O);// autogen'd. - static const char *getRegisterName(unsigned RegNo); - - void EmitInstruction(const MachineInstr *MI) { - SmallString<128> Str; - raw_svector_ostream OS(Str); - printInstruction(MI, OS); - OutStreamer.EmitRawText(OS.str()); - } - bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, - unsigned AsmVariant, const char *ExtraCode, - raw_ostream &O); - bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, - unsigned AsmVariant, const char *ExtraCode, - raw_ostream &O); - }; -} // end of anonymous namespace - -#include "BlackfinGenAsmWriter.inc" - -extern "C" void LLVMInitializeBlackfinAsmPrinter() { - RegisterAsmPrinter<BlackfinAsmPrinter> X(TheBlackfinTarget); -} - -void BlackfinAsmPrinter::printOperand(const MachineInstr *MI, int opNum, - raw_ostream &O) { - const MachineOperand &MO = MI->getOperand(opNum); - switch (MO.getType()) { - case MachineOperand::MO_Register: - assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) && - "Virtual registers should be already mapped!"); - O << getRegisterName(MO.getReg()); - break; - - case MachineOperand::MO_Immediate: - O << MO.getImm(); - break; - case MachineOperand::MO_MachineBasicBlock: - O << *MO.getMBB()->getSymbol(); - return; - case MachineOperand::MO_GlobalAddress: - O << *Mang->getSymbol(MO.getGlobal()); - printOffset(MO.getOffset(), O); - break; - case MachineOperand::MO_ExternalSymbol: - O << *GetExternalSymbolSymbol(MO.getSymbolName()); - break; - case MachineOperand::MO_ConstantPoolIndex: - O << MAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << "_" - << MO.getIndex(); - break; - case MachineOperand::MO_JumpTableIndex: - O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() - << '_' << MO.getIndex(); - break; - default: - llvm_unreachable("<unknown operand type>"); - break; - } -} - -void BlackfinAsmPrinter::printMemoryOperand(const MachineInstr *MI, int opNum, - raw_ostream &O) { - printOperand(MI, opNum, O); - - if (MI->getOperand(opNum+1).isImm() && MI->getOperand(opNum+1).getImm() == 0) - return; - - O << " + "; - printOperand(MI, opNum+1, O); -} - -/// PrintAsmOperand - Print out an operand for an inline asm expression. -/// -bool BlackfinAsmPrinter::PrintAsmOperand(const MachineInstr *MI, - unsigned OpNo, unsigned AsmVariant, - const char *ExtraCode, - raw_ostream &O) { - if (ExtraCode && ExtraCode[0]) { - if (ExtraCode[1] != 0) return true; // Unknown modifier. - - switch (ExtraCode[0]) { - default: return true; // Unknown modifier. - case 'r': - break; - } - } - - printOperand(MI, OpNo, O); - - return false; -} - -bool BlackfinAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, - unsigned OpNo, - unsigned AsmVariant, - const char *ExtraCode, - raw_ostream &O) { - if (ExtraCode && ExtraCode[0]) - return true; // Unknown modifier - - O << '['; - printOperand(MI, OpNo, O); - O << ']'; - - return false; -} diff --git a/lib/Target/Blackfin/BlackfinCallingConv.td b/lib/Target/Blackfin/BlackfinCallingConv.td deleted file mode 100644 index 0abc84c3c4..0000000000 --- a/lib/Target/Blackfin/BlackfinCallingConv.td +++ /dev/null @@ -1,30 +0,0 @@ -//===--- BlackfinCallingConv.td - Calling Conventions ------*- tablegen -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This describes the calling conventions for the Blackfin architectures. -// -//===----------------------------------------------------------------------===// - -// Blackfin C Calling convention. -def CC_Blackfin : CallingConv<[ - CCIfType<[i16], CCPromoteToType<i32>>, - CCIfSRet<CCAssignToReg<[P0]>>, - CCAssignToReg<[R0, R1, R2]>, - CCAssignToStack<4, 4> -]>; - -//===----------------------------------------------------------------------===// -// Return Value Calling Conventions -//===----------------------------------------------------------------------===// - -// Blackfin C return-value convention. -def RetCC_Blackfin : CallingConv<[ - CCIfType<[i16], CCPromoteToType<i32>>, - CCAssignToReg<[R0, R1]> -]>; diff --git a/lib/Target/Blackfin/BlackfinFrameLowering.cpp b/lib/Target/Blackfin/BlackfinFrameLowering.cpp deleted file mode 100644 index 0b0984d2f7..0000000000 --- a/lib/Target/Blackfin/BlackfinFrameLowering.cpp +++ /dev/null @@ -1,130 +0,0 @@ -//====- BlackfinFrameLowering.cpp - Blackfin Frame Information --*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the Blackfin implementation of TargetFrameLowering class. -// -//===----------------------------------------------------------------------===// - -#include "BlackfinFrameLowering.h" -#include "BlackfinInstrInfo.h" -#include "llvm/CodeGen/MachineFrameInfo.h" -#include "llvm/CodeGen/MachineFunction.h" -#include "llvm/CodeGen/MachineInstrBuilder.h" -#include "llvm/CodeGen/RegisterScavenging.h" -#include "llvm/Target/TargetOptions.h" - -using namespace llvm; - - -// hasFP - Return true if the specified function should have a dedicated frame -// pointer register. This is true if the function has variable sized allocas or -// if frame pointer elimination is disabled. -bool BlackfinFrameLowering::hasFP(const MachineFunction &MF) const { - const MachineFrameInfo *MFI = MF.getFrameInfo(); - return DisableFramePointerElim(MF) || - MFI->adjustsStack() || MFI->hasVarSizedObjects(); -} - -// Always reserve a call frame. We dont have enough registers to adjust SP. -bool BlackfinFrameLowering:: -hasReservedCallFrame(const MachineFunction &MF) const { - return true; -} - -// Emit a prologue that sets up a stack frame. -// On function entry, R0-R2 and P0 may hold arguments. -// R3, P1, and P2 may be used as scratch registers -void BlackfinFrameLowering::emitPrologue(MachineFunction &MF) const { - MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB - MachineBasicBlock::iterator MBBI = MBB.begin(); - MachineFrameInfo *MFI = MF.getFrameInfo(); - const BlackfinRegisterInfo *RegInfo = - static_cast<const BlackfinRegisterInfo*>(MF.getTarget().getRegisterInfo()); - const BlackfinInstrInfo &TII = - *static_cast<const BlackfinInstrInfo*>(MF.getTarget().getInstrInfo()); - - DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc(); - - int FrameSize = MFI->getStackSize(); - if (FrameSize%4) { - FrameSize = (FrameSize+3) & ~3; - MFI->setStackSize(FrameSize); - } - - if (!hasFP(MF)) { - assert(!MFI->adjustsStack() && - "FP elimination on a non-leaf function is not supported"); - RegInfo->adjustRegister(MBB, MBBI, dl, BF::SP, BF::P1, -FrameSize); - return; - } - - // emit a LINK instruction - if (FrameSize <= 0x3ffff) { - BuildMI(MBB, MBBI, dl, TII.get(BF::LINK)).addImm(FrameSize); - return; - } - - // Frame is too big, do a manual LINK: - // [--SP] = RETS; - // [--SP] = FP; - // FP = SP; - // P1 = -FrameSize; - // SP = SP + P1; - BuildMI(MBB, MBBI, dl, TII.get(BF::PUSH)) - .addReg(BF::RETS, RegState::Kill); - BuildMI(MBB, MBBI, dl, TII.get(BF::PUSH)) - .addReg(BF::FP, RegState::Kill); - BuildMI(MBB, MBBI, dl, TII.get(BF::MOVE), BF::FP) - .addReg(BF::SP); - RegInfo->loadConstant(MBB, MBBI, dl, BF::P1, -FrameSize); - BuildMI(MBB, MBBI, dl, TII.get(BF::ADDpp), BF::SP) - .addReg(BF::SP, RegState::Kill) - .addReg(BF::P1, RegState::Kill); - -} - -void BlackfinFrameLowering::emitEpilogue(MachineFunction &MF, - MachineBasicBlock &MBB) const { - MachineFrameInfo *MFI = MF.getFrameInfo(); - const BlackfinRegisterInfo *RegInfo = - static_cast<const BlackfinRegisterInfo*>(MF.getTarget().getRegisterInfo()); - const BlackfinInstrInfo &TII = - *static_cast<const BlackfinInstrInfo*>(MF.getTarget().getInstrInfo()); - MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr(); - DebugLoc dl = MBBI->getDebugLoc(); - - int FrameSize = MFI->getStackSize(); - assert(FrameSize%4 == 0 && "Misaligned frame size"); - - if (!hasFP(MF)) { - assert(!MFI->adjustsStack() && - "FP elimination on a non-leaf function is not supported"); - RegInfo->adjustRegister(MBB, MBBI, dl, BF::SP, BF::P1, FrameSize); - return; - } - - // emit an UNLINK instruction - BuildMI(MBB, MBBI, dl, TII.get(BF::UNLINK)); -} - -void BlackfinFrameLowering:: -processFunctionBeforeCalleeSavedScan(MachineFunction &MF, - RegScavenger *RS) const { - MachineFrameInfo *MFI = MF.getFrameInfo(); - const BlackfinRegisterInfo *RegInfo = - static_cast<const BlackfinRegisterInfo*>(MF.getTarget().getRegisterInfo()); - const TargetRegisterClass *RC = BF::DPRegisterClass; - - if (RegInfo->requiresRegisterScavenging(MF)) { - // Reserve a slot close to SP or frame pointer. - RS->setScavengingFrameIndex(MFI->CreateStackObject(RC->getSize(), - RC->getAlignment(), - false)); - } -} diff --git a/lib/Target/Blackfin/BlackfinFrameLowering.h b/lib/Target/Blackfin/BlackfinFrameLowering.h deleted file mode 100644 index 169aa8e301..0000000000 --- a/lib/Target/Blackfin/BlackfinFrameLowering.h +++ /dev/null @@ -1,47 +0,0 @@ -//=- BlackfinFrameLowering.h - Define frame lowering for Blackfin -*- C++ -*-=// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// -// -//===----------------------------------------------------------------------===// - -#ifndef BLACKFIN_FRAMEINFO_H -#define BLACKFIN_FRAMEINFO_H - -#include "Blackfin.h" -#include "BlackfinSubtarget.h" -#include "llvm/Target/TargetFrameLowering.h" - -namespace llvm { - class BlackfinSubtarget; - -class BlackfinFrameLowering : public TargetFrameLowering { -protected: - const BlackfinSubtarget &STI; - -public: - explicit BlackfinFrameLowering(const BlackfinSubtarget &sti) - : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 4, 0), STI(sti) { - } - - /// emitProlog/emitEpilog - These methods insert prolog and epilog code into - /// the function. - void emitPrologue(MachineFunction &MF) const; - void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; - - bool hasFP(const MachineFunction &MF) const; - bool hasReservedCallFrame(const MachineFunction &MF) const; - - void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, |