]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / lib / Target / Blackfin / BlackfinRegisterInfo.h
1 //===- BlackfinRegisterInfo.h - Blackfin Register Information ..-*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the Blackfin implementation of the TargetRegisterInfo
11 // class.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef BLACKFINREGISTERINFO_H
16 #define BLACKFINREGISTERINFO_H
17
18 #include "llvm/Target/TargetRegisterInfo.h"
19
20 #define GET_REGINFO_HEADER
21 #include "BlackfinGenRegisterInfo.inc"
22
23 namespace llvm {
24
25   class BlackfinSubtarget;
26   class TargetInstrInfo;
27   class Type;
28
29   struct BlackfinRegisterInfo : public BlackfinGenRegisterInfo {
30     BlackfinSubtarget &Subtarget;
31     const TargetInstrInfo &TII;
32
33     BlackfinRegisterInfo(BlackfinSubtarget &st, const TargetInstrInfo &tii);
34
35     /// Code Generation virtual methods...
36     const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
37
38     BitVector getReservedRegs(const MachineFunction &MF) const;
39
40     // getSubReg implemented by tablegen
41
42     const TargetRegisterClass *getPointerRegClass(unsigned Kind = 0) const {
43       return &BF::PRegClass;
44     }
45
46     bool requiresRegisterScavenging(const MachineFunction &MF) const;
47
48     void eliminateCallFramePseudoInstr(MachineFunction &MF,
49                                        MachineBasicBlock &MBB,
50                                        MachineBasicBlock::iterator I) const;
51
52     void eliminateFrameIndex(MachineBasicBlock::iterator II,
53                              int SPAdj, RegScavenger *RS = NULL) const;
54
55     unsigned getFrameRegister(const MachineFunction &MF) const;
56     unsigned getRARegister() const;
57
58     // Exception handling queries.
59     unsigned getEHExceptionRegister() const;
60     unsigned getEHHandlerRegister() const;
61
62     int getDwarfRegNum(unsigned RegNum, bool isEH) const;
63     int getLLVMRegNum(unsigned RegNum, bool isEH) const;
64
65     // Utility functions
66     void adjustRegister(MachineBasicBlock &MBB,
67                         MachineBasicBlock::iterator I,
68                         DebugLoc DL,
69                         unsigned Reg,
70                         unsigned ScratchReg,
71                         int delta) const;
72     void loadConstant(MachineBasicBlock &MBB,
73                       MachineBasicBlock::iterator I,
74                       DebugLoc DL,
75                       unsigned Reg,
76                       int value) const;
77   };
78
79 } // end namespace llvm
80
81 #endif