xref: /freebsd-src/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYRegisterInfo.h (revision 0eae32dcef82f6f06de6419a0d623d7def0cc8f6)
1349cc55cSDimitry Andric //===-- CSKYRegisterInfo.h - CSKY Register Information Impl ---*- C++ -*---===//
2349cc55cSDimitry Andric //
3349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6349cc55cSDimitry Andric //
7349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
8349cc55cSDimitry Andric //
9349cc55cSDimitry Andric // This file contains the CSKY implementation of the TargetRegisterInfo class.
10349cc55cSDimitry Andric //
11349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
12349cc55cSDimitry Andric 
13349cc55cSDimitry Andric #ifndef LLVM_LIB_TARGET_CSKY_CSKYREGISTERINFO_H
14349cc55cSDimitry Andric #define LLVM_LIB_TARGET_CSKY_CSKYREGISTERINFO_H
15349cc55cSDimitry Andric 
16349cc55cSDimitry Andric #include "llvm/CodeGen/TargetRegisterInfo.h"
17349cc55cSDimitry Andric 
18349cc55cSDimitry Andric #define GET_REGINFO_HEADER
19349cc55cSDimitry Andric #include "CSKYGenRegisterInfo.inc"
20349cc55cSDimitry Andric 
21349cc55cSDimitry Andric namespace llvm {
22349cc55cSDimitry Andric class CSKYInstrInfo;
23349cc55cSDimitry Andric 
24349cc55cSDimitry Andric class CSKYRegisterInfo : public CSKYGenRegisterInfo {
25349cc55cSDimitry Andric public:
26349cc55cSDimitry Andric   CSKYRegisterInfo();
27349cc55cSDimitry Andric 
28349cc55cSDimitry Andric   const uint32_t *getCallPreservedMask(const MachineFunction &MF,
29349cc55cSDimitry Andric                                        CallingConv::ID id) const override;
30349cc55cSDimitry Andric   const uint32_t *getNoPreservedMask() const override;
31349cc55cSDimitry Andric 
32349cc55cSDimitry Andric   BitVector getReservedRegs(const MachineFunction &MF) const override;
33349cc55cSDimitry Andric 
34349cc55cSDimitry Andric   Register getFrameRegister(const MachineFunction &MF) const override;
35349cc55cSDimitry Andric 
36349cc55cSDimitry Andric   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
37349cc55cSDimitry Andric 
38349cc55cSDimitry Andric   void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
39349cc55cSDimitry Andric                            unsigned FIOperandNum,
40349cc55cSDimitry Andric                            RegScavenger *RS) const override;
41*0eae32dcSDimitry Andric 
42*0eae32dcSDimitry Andric   bool requiresFrameIndexScavenging(const MachineFunction &MF) const override {
43*0eae32dcSDimitry Andric     return true;
44*0eae32dcSDimitry Andric   }
45*0eae32dcSDimitry Andric 
46*0eae32dcSDimitry Andric   bool requiresRegisterScavenging(const MachineFunction &MF) const override {
47*0eae32dcSDimitry Andric     return true;
48*0eae32dcSDimitry Andric   }
49*0eae32dcSDimitry Andric 
50*0eae32dcSDimitry Andric   bool useFPForScavengingIndex(const MachineFunction &MF) const override {
51*0eae32dcSDimitry Andric     return false;
52*0eae32dcSDimitry Andric   }
53349cc55cSDimitry Andric };
54349cc55cSDimitry Andric 
55349cc55cSDimitry Andric } // namespace llvm
56349cc55cSDimitry Andric 
57349cc55cSDimitry Andric #endif // LLVM_LIB_TARGET_CSKY_CSKYREGISTERINFO_H
58