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"
20 #define GET_REGINFO_HEADER
21 #include "BlackfinGenRegisterInfo.inc"
25 class BlackfinSubtarget;
26 class TargetInstrInfo;
29 struct BlackfinRegisterInfo : public BlackfinGenRegisterInfo {
30 BlackfinSubtarget &Subtarget;
31 const TargetInstrInfo &TII;
33 BlackfinRegisterInfo(BlackfinSubtarget &st, const TargetInstrInfo &tii);
35 /// Code Generation virtual methods...
36 const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
38 BitVector getReservedRegs(const MachineFunction &MF) const;
40 // getSubReg implemented by tablegen
42 const TargetRegisterClass *getPointerRegClass(unsigned Kind = 0) const {
43 return &BF::PRegClass;
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;
57 // Exception handling queries.
58 unsigned getEHExceptionRegister() const;
59 unsigned getEHHandlerRegister() const;
62 void adjustRegister(MachineBasicBlock &MBB,
63 MachineBasicBlock::iterator I,
68 void loadConstant(MachineBasicBlock &MBB,
69 MachineBasicBlock::iterator I,
75 } // end namespace llvm