PPCRegisterInfo.h revision 768c65f677af3f05c2e94982043f90a1bfaceda5
1//===- PPCRegisterInfo.h - PowerPC Register Information Impl -----*- 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 PowerPC implementation of the TargetRegisterInfo
11// class.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef POWERPC32_REGISTERINFO_H
16#define POWERPC32_REGISTERINFO_H
17
18#include "PPC.h"
19#include <map>
20
21#define GET_REGINFO_HEADER
22#include "PPCGenRegisterInfo.inc"
23
24namespace llvm {
25class PPCSubtarget;
26class TargetInstrInfo;
27class Type;
28
29class PPCRegisterInfo : public PPCGenRegisterInfo {
30  std::map<unsigned, unsigned> ImmToIdxMap;
31  const PPCSubtarget &Subtarget;
32  const TargetInstrInfo &TII;
33public:
34  PPCRegisterInfo(const PPCSubtarget &SubTarget, const TargetInstrInfo &tii);
35
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;
39
40  unsigned getRegPressureLimit(const TargetRegisterClass *RC,
41                               MachineFunction &MF) const;
42
43  /// Code Generation virtual methods...
44  const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
45
46  BitVector getReservedRegs(const MachineFunction &MF) const;
47
48  /// requiresRegisterScavenging - We require a register scavenger.
49  /// FIXME (64-bit): Should be inlined.
50  bool requiresRegisterScavenging(const MachineFunction &MF) const;
51
52  void eliminateCallFramePseudoInstr(MachineFunction &MF,
53                                     MachineBasicBlock &MBB,
54                                     MachineBasicBlock::iterator I) const;
55
56  void lowerDynamicAlloc(MachineBasicBlock::iterator II,
57                         int SPAdj, RegScavenger *RS) const;
58  void lowerCRSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex,
59                       int SPAdj, RegScavenger *RS) const;
60  void eliminateFrameIndex(MachineBasicBlock::iterator II,
61                           int SPAdj, RegScavenger *RS = NULL) const;
62
63  // Debug information queries.
64  unsigned getFrameRegister(const MachineFunction &MF) const;
65
66  // Exception handling queries.
67  unsigned getEHExceptionRegister() const;
68  unsigned getEHHandlerRegister() const;
69};
70
71} // end namespace llvm
72
73#endif
74