]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.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
57     // Exception handling queries.
58     unsigned getEHExceptionRegister() const;
59     unsigned getEHHandlerRegister() const;
60
61     // Utility functions
62     void adjustRegister(MachineBasicBlock &MBB,
63                         MachineBasicBlock::iterator I,
64                         DebugLoc DL,
65                         unsigned Reg,
66                         unsigned ScratchReg,
67                         int delta) const;
68     void loadConstant(MachineBasicBlock &MBB,
69                       MachineBasicBlock::iterator I,
70                       DebugLoc DL,
71                       unsigned Reg,
72                       int value) const;
73   };
74
75 } // end namespace llvm
76
77 #endif