]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/Target/ARM/Thumb2RegisterInfo.h
Import LLVM 74788.
[FreeBSD/FreeBSD.git] / lib / Target / ARM / Thumb2RegisterInfo.h
1 //===- Thumb2RegisterInfo.h - Thumb-2 Register Information Impl ----*- 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 Thumb-2 implementation of the TargetRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef THUMB2REGISTERINFO_H
15 #define THUMB2REGISTERINFO_H
16
17 #include "ARM.h"
18 #include "ARMRegisterInfo.h"
19 #include "llvm/Target/TargetRegisterInfo.h"
20
21 namespace llvm {
22   class ARMSubtarget;
23   class TargetInstrInfo;
24   class Type;
25
26 struct Thumb2RegisterInfo : public ARMBaseRegisterInfo {
27 public:
28   Thumb2RegisterInfo(const TargetInstrInfo &tii, const ARMSubtarget &STI);
29
30   /// emitLoadConstPool - Emits a load from constpool to materialize the
31   /// specified immediate.
32   void emitLoadConstPool(MachineBasicBlock &MBB,
33                          MachineBasicBlock::iterator &MBBI,
34                          unsigned DestReg, int Val,
35                          const TargetInstrInfo *TII,
36                          DebugLoc dl) const;
37
38   /// Code Generation virtual methods...
39   const TargetRegisterClass *
40     getPhysicalRegisterRegClass(unsigned Reg, MVT VT = MVT::Other) const;
41
42   bool isReservedReg(const MachineFunction &MF, unsigned Reg) const;
43
44   bool requiresRegisterScavenging(const MachineFunction &MF) const;
45
46   bool hasReservedCallFrame(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   void emitPrologue(MachineFunction &MF) const;
56   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
57 };
58 }
59
60 #endif // THUMB2REGISTERINFO_H