1 //===- Thumb2RegisterInfo.h - Thumb-2 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-2 implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef THUMB2REGISTERINFO_H
15 #define THUMB2REGISTERINFO_H
18 #include "ARMRegisterInfo.h"
19 #include "llvm/Target/TargetRegisterInfo.h"
23 class ARMBaseInstrInfo;
26 struct Thumb2RegisterInfo : public ARMBaseRegisterInfo {
28 Thumb2RegisterInfo(const ARMBaseInstrInfo &tii, const ARMSubtarget &STI);
30 // rewrite MI to access 'Offset' bytes from the FP. Return the offset that
31 // could not be handled directly in MI.
32 int rewriteFrameIndex(MachineInstr &MI, unsigned FrameRegIdx,
33 unsigned FrameReg, int Offset) const;
35 /// emitLoadConstPool - Emits a load from constpool to materialize the
36 /// specified immediate.
37 void emitLoadConstPool(MachineBasicBlock &MBB,
38 MachineBasicBlock::iterator &MBBI,
40 unsigned DestReg, unsigned SubIdx, int Val,
41 ARMCC::CondCodes Pred = ARMCC::AL,
42 unsigned PredReg = 0) const;
44 bool requiresRegisterScavenging(const MachineFunction &MF) const;
48 #endif // THUMB2REGISTERINFO_H