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 hasReservedCallFrame(MachineFunction &MF) const;
46 bool requiresRegisterScavenging(const MachineFunction
&MF
) const;
48 void eliminateCallFramePseudoInstr(MachineFunction
&MF
,
49 MachineBasicBlock
&MBB
,
50 MachineBasicBlock::iterator I
) const;
52 void eliminateFrameIndex(MachineBasicBlock::iterator II
,
53 int SPAdj
, RegScavenger
*RS
= NULL
) const;
55 unsigned getFrameRegister(const MachineFunction
&MF
) const;
56 unsigned getRARegister() const;
58 // Exception handling queries.
59 unsigned getEHExceptionRegister() const;
60 unsigned getEHHandlerRegister() const;
62 int getDwarfRegNum(unsigned RegNum
, bool isEH
) const;
65 void adjustRegister(MachineBasicBlock
&MBB
,
66 MachineBasicBlock::iterator I
,
71 void loadConstant(MachineBasicBlock
&MBB
,
72 MachineBasicBlock::iterator I
,
78 } // end namespace llvm