1 //===- BlackfinRegisterInfo.h - Blackfin Register Information ..-*- 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 Blackfin implementation of the TargetRegisterInfo
13 //===----------------------------------------------------------------------===//
15 #ifndef BLACKFINREGISTERINFO_H
16 #define BLACKFINREGISTERINFO_H
18 #include "llvm/Target/TargetRegisterInfo.h"
19 #include "BlackfinGenRegisterInfo.h.inc"
23 class BlackfinSubtarget
;
24 class TargetInstrInfo
;
27 struct BlackfinRegisterInfo
: public BlackfinGenRegisterInfo
{
28 BlackfinSubtarget
&Subtarget
;
29 const TargetInstrInfo
&TII
;
31 BlackfinRegisterInfo(BlackfinSubtarget
&st
, const TargetInstrInfo
&tii
);
33 /// Code Generation virtual methods...
34 const unsigned *getCalleeSavedRegs(const MachineFunction
*MF
= 0) const;
36 BitVector
getReservedRegs(const MachineFunction
&MF
) const;
38 // getSubReg implemented by tablegen
40 const TargetRegisterClass
*getPointerRegClass(unsigned Kind
= 0) const {
41 return &BF::PRegClass
;
44 bool hasFP(const MachineFunction
&MF
) const;
46 // bool hasReservedCallFrame(MachineFunction &MF) const;
48 bool requiresRegisterScavenging(const MachineFunction
&MF
) const;
50 void eliminateCallFramePseudoInstr(MachineFunction
&MF
,
51 MachineBasicBlock
&MBB
,
52 MachineBasicBlock::iterator I
) const;
54 void eliminateFrameIndex(MachineBasicBlock::iterator II
,
55 int SPAdj
, RegScavenger
*RS
= NULL
) const;
57 void processFunctionBeforeCalleeSavedScan(MachineFunction
&MF
,
58 RegScavenger
*RS
) const;
60 void emitPrologue(MachineFunction
&MF
) const;
61 void emitEpilogue(MachineFunction
&MF
, MachineBasicBlock
&MBB
) const;
63 unsigned getFrameRegister(const MachineFunction
&MF
) const;
64 unsigned getRARegister() const;
66 // Exception handling queries.
67 unsigned getEHExceptionRegister() const;
68 unsigned getEHHandlerRegister() const;
70 int getDwarfRegNum(unsigned RegNum
, bool isEH
) const;
73 void adjustRegister(MachineBasicBlock
&MBB
,
74 MachineBasicBlock::iterator I
,
79 void loadConstant(MachineBasicBlock
&MBB
,
80 MachineBasicBlock::iterator I
,
86 } // end namespace llvm