1 //===- SparcRegisterInfo.h - Sparc Register Information Impl ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the Sparc implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef SPARCREGISTERINFO_H
15 #define SPARCREGISTERINFO_H
17 #include "llvm/Target/MRegisterInfo.h"
18 #include "SparcGenRegisterInfo.h.inc"
23 class TargetInstrInfo;
26 struct SparcRegisterInfo : public SparcGenRegisterInfo {
27 SparcSubtarget &Subtarget;
28 const TargetInstrInfo &TII;
30 SparcRegisterInfo(SparcSubtarget &st, const TargetInstrInfo &tii);
32 /// Code Generation virtual methods...
33 void storeRegToStackSlot(MachineBasicBlock &MBB,
34 MachineBasicBlock::iterator MBBI,
35 unsigned SrcReg, int FrameIndex,
36 const TargetRegisterClass *RC) const;
38 void loadRegFromStackSlot(MachineBasicBlock &MBB,
39 MachineBasicBlock::iterator MBBI,
40 unsigned DestReg, int FrameIndex,
41 const TargetRegisterClass *RC) const;
43 void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
44 unsigned DestReg, unsigned SrcReg,
45 const TargetRegisterClass *RC) const;
47 virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
49 int FrameIndex) const;
51 const unsigned *getCalleeSavedRegs() const;
53 const TargetRegisterClass* const* getCalleeSavedRegClasses() const;
55 BitVector getReservedRegs(const MachineFunction &MF) const;
57 bool hasFP(const MachineFunction &MF) const;
59 void eliminateCallFramePseudoInstr(MachineFunction &MF,
60 MachineBasicBlock &MBB,
61 MachineBasicBlock::iterator I) const;
63 void eliminateFrameIndex(MachineBasicBlock::iterator II) const;
65 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
67 void emitPrologue(MachineFunction &MF) const;
68 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
70 // Debug information queries.
71 unsigned getRARegister() const;
72 unsigned getFrameRegister(MachineFunction &MF) const;
75 } // end namespace llvm