Use BranchProbability instead of floating points in IfConverter.
[llvm/stm8.git] / lib / Target / Blackfin / BlackfinRegisterInfo.h
blob86f45c17c62525e513709b2cef46371aac945dbf
1 //===- BlackfinRegisterInfo.h - Blackfin Register Information ..-*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the Blackfin implementation of the TargetRegisterInfo
11 // class.
13 //===----------------------------------------------------------------------===//
15 #ifndef BLACKFINREGISTERINFO_H
16 #define BLACKFINREGISTERINFO_H
18 #include "llvm/Target/TargetRegisterInfo.h"
20 #define GET_REGINFO_HEADER
21 #include "BlackfinGenRegisterInfo.inc"
23 namespace llvm {
25 class BlackfinSubtarget;
26 class TargetInstrInfo;
27 class Type;
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;
56 unsigned getRARegister() const;
58 // Exception handling queries.
59 unsigned getEHExceptionRegister() const;
60 unsigned getEHHandlerRegister() const;
62 int getDwarfRegNum(unsigned RegNum, bool isEH) const;
63 int getLLVMRegNum(unsigned RegNum, bool isEH) const;
65 // Utility functions
66 void adjustRegister(MachineBasicBlock &MBB,
67 MachineBasicBlock::iterator I,
68 DebugLoc DL,
69 unsigned Reg,
70 unsigned ScratchReg,
71 int delta) const;
72 void loadConstant(MachineBasicBlock &MBB,
73 MachineBasicBlock::iterator I,
74 DebugLoc DL,
75 unsigned Reg,
76 int value) const;
79 } // end namespace llvm
81 #endif