2cd9e8dc5da9d65a0277513a8f615d6eb131ec02
[oota-llvm.git] / lib / Target / Alpha / AlphaRegisterInfo.h
1 //===- AlphaRegisterInfo.h - Alpha Register Information Impl ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
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.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the Alpha implementation of the MRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef ALPHAREGISTERINFO_H
15 #define ALPHAREGISTERINFO_H
16
17 #include "llvm/Target/MRegisterInfo.h"
18 #include "AlphaGenRegisterInfo.h.inc"
19
20 namespace llvm {
21
22 class TargetInstrInfo;
23 class Type;
24
25 struct AlphaRegisterInfo : public AlphaGenRegisterInfo {
26   const TargetInstrInfo &TII;
27
28   AlphaRegisterInfo(const TargetInstrInfo &tii);
29
30   /// Code Generation virtual methods...
31   void storeRegToStackSlot(MachineBasicBlock &MBB,
32                            MachineBasicBlock::iterator MBBI,
33                            unsigned SrcReg, int FrameIndex,
34                            const TargetRegisterClass *RC) const;
35
36   void loadRegFromStackSlot(MachineBasicBlock &MBB,
37                             MachineBasicBlock::iterator MBBI,
38                             unsigned DestReg, int FrameIndex,
39                             const TargetRegisterClass *RC) const;
40   
41   MachineInstr* foldMemoryOperand(MachineInstr *MI, unsigned OpNum, 
42                                   int FrameIndex) const;
43
44   void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
45                     unsigned DestReg, unsigned SrcReg,
46                     const TargetRegisterClass *RC) const;
47
48   const unsigned *getCalleeSaveRegs() const;
49
50   const TargetRegisterClass* const* getCalleeSaveRegClasses() const;
51
52   void eliminateCallFramePseudoInstr(MachineFunction &MF,
53                                      MachineBasicBlock &MBB,
54                                      MachineBasicBlock::iterator I) const;
55
56   void eliminateFrameIndex(MachineBasicBlock::iterator II) const;
57
58   //void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
59
60   void emitPrologue(MachineFunction &MF) const;
61   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
62
63   // Debug information queries.
64   unsigned getRARegister() const;
65   unsigned getFrameRegister(MachineFunction &MF) const;
66
67   static std::string getPrettyName(unsigned reg);
68 };
69
70 } // end namespace llvm
71
72 #endif