2013-05-06 18:15:19 +02:00
|
|
|
//===-- SystemZRegisterInfo.h - SystemZ register information ----*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 18:26:38 +02:00
|
|
|
#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZREGISTERINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZREGISTERINFO_H
|
2013-05-06 18:15:19 +02:00
|
|
|
|
|
|
|
#include "SystemZ.h"
|
|
|
|
#include "llvm/Target/TargetRegisterInfo.h"
|
|
|
|
|
|
|
|
#define GET_REGINFO_HEADER
|
|
|
|
#include "SystemZGenRegisterInfo.inc"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
namespace SystemZ {
|
2014-03-06 11:38:30 +01:00
|
|
|
// Return the subreg to use for referring to the even and odd registers
|
|
|
|
// in a GR128 pair. Is32Bit says whether we want a GR32 or GR64.
|
|
|
|
inline unsigned even128(bool Is32bit) {
|
|
|
|
return Is32bit ? subreg_hl32 : subreg_h64;
|
2013-05-06 18:15:19 +02:00
|
|
|
}
|
2014-03-06 11:38:30 +01:00
|
|
|
inline unsigned odd128(bool Is32bit) {
|
|
|
|
return Is32bit ? subreg_l32 : subreg_l64;
|
|
|
|
}
|
|
|
|
} // end namespace SystemZ
|
2013-05-06 18:15:19 +02:00
|
|
|
|
|
|
|
struct SystemZRegisterInfo : public SystemZGenRegisterInfo {
|
|
|
|
public:
|
2014-06-27 09:01:17 +02:00
|
|
|
SystemZRegisterInfo();
|
2013-05-06 18:15:19 +02:00
|
|
|
|
2016-04-24 15:57:49 +02:00
|
|
|
/// getPointerRegClass - Return the register class to use to hold pointers.
|
|
|
|
/// This is currently only used by LOAD_STACK_GUARD, which requires a non-%r0
|
|
|
|
/// register, hence ADDR64.
|
|
|
|
const TargetRegisterClass *
|
|
|
|
getPointerRegClass(const MachineFunction &MF,
|
|
|
|
unsigned Kind=0) const override {
|
|
|
|
return &SystemZ::ADDR64BitRegClass;
|
|
|
|
}
|
|
|
|
|
2013-05-06 18:15:19 +02:00
|
|
|
// Override TargetRegisterInfo.h.
|
2014-03-06 13:03:36 +01:00
|
|
|
bool requiresRegisterScavenging(const MachineFunction &MF) const override {
|
2013-05-06 18:15:19 +02:00
|
|
|
return true;
|
|
|
|
}
|
2014-03-06 13:03:36 +01:00
|
|
|
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override {
|
2013-05-06 18:15:19 +02:00
|
|
|
return true;
|
|
|
|
}
|
2014-03-06 13:03:36 +01:00
|
|
|
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override {
|
2013-09-25 12:11:07 +02:00
|
|
|
return true;
|
|
|
|
}
|
2015-03-11 22:41:28 +01:00
|
|
|
const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
|
2015-03-11 23:42:13 +01:00
|
|
|
const uint32_t *getCallPreservedMask(const MachineFunction &MF,
|
|
|
|
CallingConv::ID CC) const override;
|
2014-03-06 13:03:36 +01:00
|
|
|
BitVector getReservedRegs(const MachineFunction &MF) const override;
|
|
|
|
void eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
|
|
|
int SPAdj, unsigned FIOperandNum,
|
|
|
|
RegScavenger *RS) const override;
|
|
|
|
unsigned getFrameRegister(const MachineFunction &MF) const override;
|
2013-05-06 18:15:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|