1 //===- Thumb1RegisterInfo.h - Thumb-1 Register Information Impl ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the Thumb-1 implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef THUMB1REGISTERINFO_H
15 #define THUMB1REGISTERINFO_H
18 #include "ARMRegisterInfo.h"
19 #include "llvm/Target/TargetRegisterInfo.h"
23 class ARMBaseInstrInfo;
26 struct Thumb1RegisterInfo : public ARMBaseRegisterInfo {
28 Thumb1RegisterInfo(const ARMBaseInstrInfo &tii, const ARMSubtarget &STI);
30 /// emitLoadConstPool - Emits a load from constpool to materialize the
31 /// specified immediate.
32 void emitLoadConstPool(MachineBasicBlock &MBB,
33 MachineBasicBlock::iterator &MBBI,
35 unsigned DestReg, unsigned SubIdx, int Val,
36 ARMCC::CondCodes Pred = ARMCC::AL,
37 unsigned PredReg = 0) const;
39 /// Code Generation virtual methods...
40 const TargetRegisterClass *
41 getPhysicalRegisterRegClass(unsigned Reg, EVT VT = MVT::Other) const;
43 bool requiresRegisterScavenging(const MachineFunction &MF) const;
44 bool requiresFrameIndexScavenging(const MachineFunction &MF) const;
46 bool hasReservedCallFrame(MachineFunction &MF) const;
48 void eliminateCallFramePseudoInstr(MachineFunction &MF,
49 MachineBasicBlock &MBB,
50 MachineBasicBlock::iterator I) const;
52 // rewrite MI to access 'Offset' bytes from the FP. Return the offset that
53 // could not be handled directly in MI.
54 int rewriteFrameIndex(MachineInstr &MI, unsigned FrameRegIdx,
55 unsigned FrameReg, int Offset,
56 unsigned MOVOpc, unsigned ADDriOpc, unsigned SUBriOpc) const;
58 bool saveScavengerRegister(MachineBasicBlock &MBB,
59 MachineBasicBlock::iterator I,
60 MachineBasicBlock::iterator &UseMI,
61 const TargetRegisterClass *RC,
63 unsigned eliminateFrameIndex(MachineBasicBlock::iterator II,
64 int SPAdj, int *Value = NULL,
65 RegScavenger *RS = NULL) const;
67 void emitPrologue(MachineFunction &MF) const;
68 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
72 #endif // THUMB1REGISTERINFO_H