1 //===- AlphaRegisterInfo.h - Alpha 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 Alpha implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef ALPHAREGISTERINFO_H
15 #define ALPHAREGISTERINFO_H
17 #include "llvm/Target/MRegisterInfo.h"
18 #include "AlphaGenRegisterInfo.h.inc"
22 class TargetInstrInfo;
25 struct AlphaRegisterInfo : public AlphaGenRegisterInfo {
26 const TargetInstrInfo &TII;
28 AlphaRegisterInfo(const TargetInstrInfo &tii);
30 /// Code Generation virtual methods...
31 void storeRegToStackSlot(MachineBasicBlock &MBB,
32 MachineBasicBlock::iterator MBBI,
33 unsigned SrcReg, int FrameIndex,
34 const TargetRegisterClass *RC) const;
36 void loadRegFromStackSlot(MachineBasicBlock &MBB,
37 MachineBasicBlock::iterator MBBI,
38 unsigned DestReg, int FrameIndex,
39 const TargetRegisterClass *RC) const;
41 MachineInstr* foldMemoryOperand(MachineInstr *MI, unsigned OpNum,
42 int FrameIndex) const;
44 void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
45 unsigned DestReg, unsigned SrcReg,
46 const TargetRegisterClass *RC) const;
48 void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
49 unsigned DestReg, const MachineInstr *Orig) 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,
64 RegScavenger *RS = NULL) const;
66 //void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
68 void emitPrologue(MachineFunction &MF) const;
69 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
71 // Debug information queries.
72 unsigned getRARegister() const;
73 unsigned getFrameRegister(MachineFunction &MF) const;
75 // Exception handling queries.
76 unsigned getEHExceptionRegister() const;
77 unsigned getEHHandlerRegister() const;
79 static std::string getPrettyName(unsigned reg);
82 } // end namespace llvm