1 //= LoongArchRegisterInfo.h - LoongArch Register Information Impl -*- C++ -*-=// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file contains the LoongArch implementation of the TargetRegisterInfo 10 // class. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_LIB_TARGET_LOONGARCH_LOONGARCHREGISTERINFO_H 15 #define LLVM_LIB_TARGET_LOONGARCH_LOONGARCHREGISTERINFO_H 16 17 #include "llvm/CodeGen/TargetRegisterInfo.h" 18 19 #define GET_REGINFO_HEADER 20 #include "LoongArchGenRegisterInfo.inc" 21 22 namespace llvm { 23 24 struct LoongArchRegisterInfo : public LoongArchGenRegisterInfo { 25 26 LoongArchRegisterInfo(unsigned HwMode); 27 28 const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override; 29 const uint32_t *getCallPreservedMask(const MachineFunction &MF, 30 CallingConv::ID) const override; 31 const uint32_t *getNoPreservedMask() const override; 32 33 BitVector getReservedRegs(const MachineFunction &MF) const override; 34 bool isConstantPhysReg(MCRegister PhysReg) const override; 35 36 const TargetRegisterClass * 37 getPointerRegClass(const MachineFunction &MF, 38 unsigned Kind = 0) const override { 39 return &LoongArch::GPRRegClass; 40 } 41 42 void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, 43 unsigned FIOperandNum, 44 RegScavenger *RS = nullptr) const override; 45 46 Register getFrameRegister(const MachineFunction &MF) const override; 47 }; 48 } // end namespace llvm 49 50 #endif // LLVM_LIB_TARGET_LOONGARCH_LOONGARCHREGISTERINFO_H 51