1 //===- SystemZRegisterInfo.h - SystemZ 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 SystemZ implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef SystemZREGISTERINFO_H
15 #define SystemZREGISTERINFO_H
17 #include "llvm/Target/TargetRegisterInfo.h"
18 #include "SystemZGenRegisterInfo.h.inc"
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.
27 SUBREG_32BIT = 1, SUBREG_EVEN = 1, SUBREG_ODD = 2
31 class SystemZSubtarget;
32 class SystemZInstrInfo;
35 struct SystemZRegisterInfo : public SystemZGenRegisterInfo {
36 SystemZTargetMachine &TM;
37 const SystemZInstrInfo &TII;
39 SystemZRegisterInfo(SystemZTargetMachine &tm, const SystemZInstrInfo &tii);
41 /// Code Generation virtual methods...
42 const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
44 const TargetRegisterClass* const* getCalleeSavedRegClasses(
45 const MachineFunction *MF = 0) const;
47 BitVector getReservedRegs(const MachineFunction &MF) const;
49 bool hasReservedCallFrame(MachineFunction &MF) const { return true; }
50 bool hasFP(const MachineFunction &MF) const;
52 int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
54 void eliminateCallFramePseudoInstr(MachineFunction &MF,
55 MachineBasicBlock &MBB,
56 MachineBasicBlock::iterator I) const;
58 unsigned eliminateFrameIndex(MachineBasicBlock::iterator II,
59 int SPAdj, int *Value = NULL,
60 RegScavenger *RS = NULL) const;
63 void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
64 RegScavenger *RS) const;
66 void emitPrologue(MachineFunction &MF) const;
67 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
69 // Debug information queries.
70 unsigned getRARegister() const;
71 unsigned getFrameRegister(const MachineFunction &MF) const;
73 // Exception handling queries.
74 unsigned getEHExceptionRegister() const;
75 unsigned getEHHandlerRegister() const;
77 int getDwarfRegNum(unsigned RegNum, bool isEH) const;
80 } // end namespace llvm