SystemZRegisterInfo.h revision ed00212f4359190df95c9970ac5b1e2fd2bda384
1//===- SystemZRegisterInfo.h - SystemZ 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 SystemZ implementation of the TargetRegisterInfo class.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef SystemZREGISTERINFO_H
15#define SystemZREGISTERINFO_H
16
17#include "llvm/Target/TargetRegisterInfo.h"
18#include "SystemZGenRegisterInfo.h.inc"
19
20namespace llvm {
21
22namespace SystemZ {
23  /// SubregIndex - The index of various sized subregister classes. Note that
24  /// these indices must be kept in sync with the class indices in the
25  /// SystemZRegisterInfo.td file.
26  enum SubregIndex {
27    SUBREG_32BIT = 1, SUBREG_EVEN = 1, SUBREG_ODD = 2
28  };
29}
30
31class SystemZSubtarget;
32class TargetInstrInfo;
33class Type;
34
35struct SystemZRegisterInfo : public SystemZGenRegisterInfo {
36  SystemZTargetMachine &TM;
37  const TargetInstrInfo &TII;
38
39  SystemZRegisterInfo(SystemZTargetMachine &tm, const TargetInstrInfo &tii);
40
41  /// Code Generation virtual methods...
42  const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
43
44  const TargetRegisterClass* const* getCalleeSavedRegClasses(
45                                     const MachineFunction *MF = 0) const;
46
47  BitVector getReservedRegs(const MachineFunction &MF) const;
48
49  bool hasReservedCallFrame(MachineFunction &MF) const;
50  bool hasFP(const MachineFunction &MF) const;
51
52  int getFrameIndexOffset(MachineFunction &MF, int FI) const;
53
54  void eliminateCallFramePseudoInstr(MachineFunction &MF,
55                                     MachineBasicBlock &MBB,
56                                     MachineBasicBlock::iterator I) const;
57
58  void eliminateFrameIndex(MachineBasicBlock::iterator II,
59                           int SPAdj, RegScavenger *RS = NULL) const;
60
61
62  void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
63                                            RegScavenger *RS) const;
64
65  void emitPrologue(MachineFunction &MF) const;
66  void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
67
68  // Debug information queries.
69  unsigned getRARegister() const;
70  unsigned getFrameRegister(MachineFunction &MF) const;
71
72  // Exception handling queries.
73  unsigned getEHExceptionRegister() const;
74  unsigned getEHHandlerRegister() const;
75
76  int getDwarfRegNum(unsigned RegNum, bool isEH) const;
77};
78
79} // end namespace llvm
80
81#endif
82