xref: /llvm-project/llvm/lib/Target/CSKY/CSKYRegisterInfo.h (revision 32bd75716c27d1a094c2436529b596ce1547f6eb)
1cf78715cSZi Xuan Wu //===-- CSKYRegisterInfo.h - CSKY Register Information Impl ---*- C++ -*---===//
2cf78715cSZi Xuan Wu //
3cf78715cSZi Xuan Wu // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4cf78715cSZi Xuan Wu // See https://llvm.org/LICENSE.txt for license information.
5cf78715cSZi Xuan Wu // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6cf78715cSZi Xuan Wu //
7cf78715cSZi Xuan Wu //===----------------------------------------------------------------------===//
8cf78715cSZi Xuan Wu //
9cf78715cSZi Xuan Wu // This file contains the CSKY implementation of the TargetRegisterInfo class.
10cf78715cSZi Xuan Wu //
11cf78715cSZi Xuan Wu //===----------------------------------------------------------------------===//
12cf78715cSZi Xuan Wu 
13cf78715cSZi Xuan Wu #ifndef LLVM_LIB_TARGET_CSKY_CSKYREGISTERINFO_H
14cf78715cSZi Xuan Wu #define LLVM_LIB_TARGET_CSKY_CSKYREGISTERINFO_H
15cf78715cSZi Xuan Wu 
16cf78715cSZi Xuan Wu #include "llvm/CodeGen/TargetRegisterInfo.h"
17cf78715cSZi Xuan Wu 
18cf78715cSZi Xuan Wu #define GET_REGINFO_HEADER
19cf78715cSZi Xuan Wu #include "CSKYGenRegisterInfo.inc"
20cf78715cSZi Xuan Wu 
21cf78715cSZi Xuan Wu namespace llvm {
22cf78715cSZi Xuan Wu class CSKYInstrInfo;
23cf78715cSZi Xuan Wu 
24cf78715cSZi Xuan Wu class CSKYRegisterInfo : public CSKYGenRegisterInfo {
25cf78715cSZi Xuan Wu public:
26cf78715cSZi Xuan Wu   CSKYRegisterInfo();
27cf78715cSZi Xuan Wu 
28cf78715cSZi Xuan Wu   const uint32_t *getCallPreservedMask(const MachineFunction &MF,
29cf78715cSZi Xuan Wu                                        CallingConv::ID id) const override;
30cf78715cSZi Xuan Wu   const uint32_t *getNoPreservedMask() const override;
31cf78715cSZi Xuan Wu 
32cf78715cSZi Xuan Wu   BitVector getReservedRegs(const MachineFunction &MF) const override;
33cf78715cSZi Xuan Wu 
34cf78715cSZi Xuan Wu   Register getFrameRegister(const MachineFunction &MF) const override;
35cf78715cSZi Xuan Wu 
36cf78715cSZi Xuan Wu   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
37cf78715cSZi Xuan Wu 
38*32bd7571SAlexander Timofeev   bool eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
39cf78715cSZi Xuan Wu                            unsigned FIOperandNum,
40cf78715cSZi Xuan Wu                            RegScavenger *RS) const override;
41a556ec88SZi Xuan Wu 
requiresFrameIndexScavenging(const MachineFunction & MF)42a556ec88SZi Xuan Wu   bool requiresFrameIndexScavenging(const MachineFunction &MF) const override {
43a556ec88SZi Xuan Wu     return true;
44a556ec88SZi Xuan Wu   }
45a556ec88SZi Xuan Wu 
requiresRegisterScavenging(const MachineFunction & MF)46a556ec88SZi Xuan Wu   bool requiresRegisterScavenging(const MachineFunction &MF) const override {
47a556ec88SZi Xuan Wu     return true;
48a556ec88SZi Xuan Wu   }
49a556ec88SZi Xuan Wu 
useFPForScavengingIndex(const MachineFunction & MF)50a556ec88SZi Xuan Wu   bool useFPForScavengingIndex(const MachineFunction &MF) const override {
51a556ec88SZi Xuan Wu     return false;
52a556ec88SZi Xuan Wu   }
53cf78715cSZi Xuan Wu };
54cf78715cSZi Xuan Wu 
55cf78715cSZi Xuan Wu } // namespace llvm
56cf78715cSZi Xuan Wu 
57cf78715cSZi Xuan Wu #endif // LLVM_LIB_TARGET_CSKY_CSKYREGISTERINFO_H
58