80-column cleanup of file header comments
[oota-llvm.git] / lib / Target / ARM / Thumb1RegisterInfo.h
1 //===- Thumb1RegisterInfo.h - Thumb-1 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-1 implementation of the TargetRegisterInfo
11 // class.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef THUMB1REGISTERINFO_H
16 #define THUMB1REGISTERINFO_H
17
18 #include "ARM.h"
19 #include "ARMRegisterInfo.h"
20 #include "llvm/Target/TargetRegisterInfo.h"
21
22 namespace llvm {
23   class ARMSubtarget;
24   class ARMBaseInstrInfo;
25   class Type;
26
27 struct Thumb1RegisterInfo : public ARMBaseRegisterInfo {
28 public:
29   Thumb1RegisterInfo(const ARMBaseInstrInfo &tii, const ARMSubtarget &STI);
30
31   /// emitLoadConstPool - Emits a load from constpool to materialize the
32   /// specified immediate.
33  void emitLoadConstPool(MachineBasicBlock &MBB,
34                         MachineBasicBlock::iterator &MBBI,
35                         DebugLoc dl,
36                         unsigned DestReg, unsigned SubIdx, int Val,
37                         ARMCC::CondCodes Pred = ARMCC::AL,
38                         unsigned PredReg = 0) const;
39
40   /// Code Generation virtual methods...
41   const TargetRegisterClass *
42     getPhysicalRegisterRegClass(unsigned Reg, EVT VT = MVT::Other) const;
43
44   bool hasReservedCallFrame(MachineFunction &MF) const;
45
46   void eliminateCallFramePseudoInstr(MachineFunction &MF,
47                                      MachineBasicBlock &MBB,
48                                      MachineBasicBlock::iterator I) const;
49
50   // rewrite MI to access 'Offset' bytes from the FP. Return the offset that
51   // could not be handled directly in MI.
52   int rewriteFrameIndex(MachineInstr &MI, unsigned FrameRegIdx,
53                         unsigned FrameReg, int Offset,
54                         unsigned MOVOpc, unsigned ADDriOpc, unsigned SUBriOpc) const;
55
56   bool saveScavengerRegister(MachineBasicBlock &MBB,
57                              MachineBasicBlock::iterator I,
58                              MachineBasicBlock::iterator &UseMI,
59                              const TargetRegisterClass *RC,
60                              unsigned Reg) const;
61   unsigned eliminateFrameIndex(MachineBasicBlock::iterator II,
62                                int SPAdj, int *Value = NULL,
63                                RegScavenger *RS = NULL) const;
64
65   void emitPrologue(MachineFunction &MF) const;
66   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
67 };
68 }
69
70 #endif // THUMB1REGISTERINFO_H