LLVM API Documentation

Thumb1RegisterInfo.h

Go to the documentation of this file.
00001 //===- Thumb1RegisterInfo.h - Thumb-1 Register Information Impl ----*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the Thumb-1 implementation of the TargetRegisterInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef THUMB1REGISTERINFO_H
00015 #define THUMB1REGISTERINFO_H
00016 
00017 #include "ARM.h"
00018 #include "ARMRegisterInfo.h"
00019 #include "llvm/Target/TargetRegisterInfo.h"
00020 
00021 namespace llvm {
00022   class ARMSubtarget;
00023   class ARMBaseInstrInfo;
00024   class Type;
00025 
00026 struct Thumb1RegisterInfo : public ARMBaseRegisterInfo {
00027 public:
00028   Thumb1RegisterInfo(const ARMBaseInstrInfo &tii, const ARMSubtarget &STI);
00029 
00030   /// emitLoadConstPool - Emits a load from constpool to materialize the
00031   /// specified immediate.
00032  void emitLoadConstPool(MachineBasicBlock &MBB,
00033                         MachineBasicBlock::iterator &MBBI,
00034                         DebugLoc dl,
00035                         unsigned DestReg, unsigned SubIdx, int Val,
00036                         ARMCC::CondCodes Pred = ARMCC::AL,
00037                         unsigned PredReg = 0) const;
00038 
00039   /// Code Generation virtual methods...
00040   const TargetRegisterClass *
00041     getPhysicalRegisterRegClass(unsigned Reg, EVT VT = MVT::Other) const;
00042 
00043   bool requiresRegisterScavenging(const MachineFunction &MF) const;
00044 
00045   bool hasReservedCallFrame(MachineFunction &MF) const;
00046 
00047   void eliminateCallFramePseudoInstr(MachineFunction &MF,
00048                                      MachineBasicBlock &MBB,
00049                                      MachineBasicBlock::iterator I) const;
00050 
00051   // rewrite MI to access 'Offset' bytes from the FP. Return the offset that
00052   // could not be handled directly in MI.
00053   int rewriteFrameIndex(MachineInstr &MI, unsigned FrameRegIdx,
00054                         unsigned FrameReg, int Offset,
00055                         unsigned MOVOpc, unsigned ADDriOpc, unsigned SUBriOpc) const;
00056 
00057   void eliminateFrameIndex(MachineBasicBlock::iterator II,
00058                            int SPAdj, RegScavenger *RS = NULL) const;
00059 
00060   void emitPrologue(MachineFunction &MF) const;
00061   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
00062 };
00063 }
00064 
00065 #endif // THUMB1REGISTERINFO_H