LLVM API Documentation

SystemZRegisterInfo.h
Go to the documentation of this file.
00001 //===-- SystemZRegisterInfo.h - SystemZ register information ----*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZREGISTERINFO_H
00011 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZREGISTERINFO_H
00012 
00013 #include "SystemZ.h"
00014 #include "llvm/Target/TargetRegisterInfo.h"
00015 
00016 #define GET_REGINFO_HEADER
00017 #include "SystemZGenRegisterInfo.inc"
00018 
00019 namespace llvm {
00020 
00021 namespace SystemZ {
00022 // Return the subreg to use for referring to the even and odd registers
00023 // in a GR128 pair.  Is32Bit says whether we want a GR32 or GR64.
00024 inline unsigned even128(bool Is32bit) {
00025   return Is32bit ? subreg_hl32 : subreg_h64;
00026 }
00027 inline unsigned odd128(bool Is32bit) {
00028   return Is32bit ? subreg_l32 : subreg_l64;
00029 }
00030 } // end namespace SystemZ
00031 
00032 struct SystemZRegisterInfo : public SystemZGenRegisterInfo {
00033 public:
00034   SystemZRegisterInfo();
00035 
00036   // Override TargetRegisterInfo.h.
00037   bool requiresRegisterScavenging(const MachineFunction &MF) const override {
00038     return true;
00039   }
00040   bool requiresFrameIndexScavenging(const MachineFunction &MF) const override {
00041     return true;
00042   }
00043   bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override {
00044     return true;
00045   }
00046   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF = nullptr) const
00047     override;
00048   const uint32_t *getCallPreservedMask(CallingConv::ID CC) const override;
00049   BitVector getReservedRegs(const MachineFunction &MF) const override;
00050   void eliminateFrameIndex(MachineBasicBlock::iterator MI,
00051                            int SPAdj, unsigned FIOperandNum,
00052                            RegScavenger *RS) const override;
00053   unsigned getFrameRegister(const MachineFunction &MF) const override;
00054 };
00055 
00056 } // end namespace llvm
00057 
00058 #endif