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(MachineFunction
&MF
, int FI
) const;
54 void eliminateCallFramePseudoInstr(MachineFunction
&MF
,
55 MachineBasicBlock
&MBB
,
56 MachineBasicBlock::iterator I
) const;
58 void eliminateFrameIndex(MachineBasicBlock::iterator II
,
59 int SPAdj
, RegScavenger
*RS
= NULL
) const;
62 void processFunctionBeforeCalleeSavedScan(MachineFunction
&MF
,
63 RegScavenger
*RS
) const;
65 void emitPrologue(MachineFunction
&MF
) const;
66 void emitEpilogue(MachineFunction
&MF
, MachineBasicBlock
&MBB
) const;
68 // Debug information queries.
69 unsigned getRARegister() const;
70 unsigned getFrameRegister(MachineFunction
&MF
) const;
72 // Exception handling queries.
73 unsigned getEHExceptionRegister() const;
74 unsigned getEHHandlerRegister() const;
76 int getDwarfRegNum(unsigned RegNum
, bool isEH
) const;
79 } // end namespace llvm