1 //===-- PPCRegisterInfo.h - PowerPC Register Information Impl ---*- 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 PowerPC implementation of the TargetRegisterInfo
13 //===----------------------------------------------------------------------===//
15 #ifndef POWERPC32_REGISTERINFO_H
16 #define POWERPC32_REGISTERINFO_H
21 #define GET_REGINFO_HEADER
22 #include "PPCGenRegisterInfo.inc"
26 class TargetInstrInfo;
29 class PPCRegisterInfo : public PPCGenRegisterInfo {
30 std::map<unsigned, unsigned> ImmToIdxMap;
31 const PPCSubtarget &Subtarget;
32 const TargetInstrInfo &TII;
34 PPCRegisterInfo(const PPCSubtarget &SubTarget, const TargetInstrInfo &tii);
36 /// getPointerRegClass - Return the register class to use to hold pointers.
37 /// This is used for addressing modes.
38 virtual const TargetRegisterClass *getPointerRegClass(unsigned Kind=0) const;
40 unsigned getRegPressureLimit(const TargetRegisterClass *RC,
41 MachineFunction &MF) const;
43 /// Code Generation virtual methods...
44 const uint16_t *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
45 const unsigned *getCallPreservedMask(CallingConv::ID CC) const;
47 BitVector getReservedRegs(const MachineFunction &MF) const;
49 /// requiresRegisterScavenging - We require a register scavenger.
50 /// FIXME (64-bit): Should be inlined.
51 bool requiresRegisterScavenging(const MachineFunction &MF) const;
53 bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const;
55 void eliminateCallFramePseudoInstr(MachineFunction &MF,
56 MachineBasicBlock &MBB,
57 MachineBasicBlock::iterator I) const;
59 void lowerDynamicAlloc(MachineBasicBlock::iterator II,
60 int SPAdj, RegScavenger *RS) const;
61 void lowerCRSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex,
62 int SPAdj, RegScavenger *RS) const;
63 void lowerCRRestore(MachineBasicBlock::iterator II, unsigned FrameIndex,
64 int SPAdj, RegScavenger *RS) const;
65 void eliminateFrameIndex(MachineBasicBlock::iterator II,
66 int SPAdj, RegScavenger *RS = NULL) const;
68 // Debug information queries.
69 unsigned getFrameRegister(const MachineFunction &MF) const;
71 // Exception handling queries.
72 unsigned getEHExceptionRegister() const;
73 unsigned getEHHandlerRegister() const;
76 } // end namespace llvm