LLVM  17.0.0git
LoongArchRegisterInfo.h
Go to the documentation of this file.
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 
18 
19 #define GET_REGINFO_HEADER
20 #include "LoongArchGenRegisterInfo.inc"
21 
22 namespace llvm {
23 
25 
26  LoongArchRegisterInfo(unsigned HwMode);
27 
28  const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
30  CallingConv::ID) const override;
31  const uint32_t *getNoPreservedMask() const override;
32 
33  BitVector getReservedRegs(const MachineFunction &MF) const override;
34 
35  const TargetRegisterClass *
37  unsigned Kind = 0) const override {
38  return &LoongArch::GPRRegClass;
39  }
40 
42  unsigned FIOperandNum,
43  RegScavenger *RS = nullptr) const override;
44 
45  Register getFrameRegister(const MachineFunction &MF) const override;
46 
47  bool requiresRegisterScavenging(const MachineFunction &MF) const override {
48  return true;
49  }
50 
51  bool requiresFrameIndexScavenging(const MachineFunction &MF) const override {
52  return true;
53  }
54 };
55 } // end namespace llvm
56 
57 #endif // LLVM_LIB_TARGET_LOONGARCH_LOONGARCHREGISTERINFO_H
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:109
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::LoongArchRegisterInfo::getCalleeSavedRegs
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Definition: LoongArchRegisterInfo.cpp:38
llvm::LoongArchRegisterInfo::eliminateFrameIndex
bool eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
Definition: LoongArchRegisterInfo.cpp:118
llvm::LoongArchRegisterInfo::getPointerRegClass
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const override
Definition: LoongArchRegisterInfo.h:36
llvm::LoongArchRegisterInfo::getCallPreservedMask
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
Definition: LoongArchRegisterInfo.cpp:59
llvm::LoongArchRegisterInfo::getNoPreservedMask
const uint32_t * getNoPreservedMask() const override
Definition: LoongArchRegisterInfo.cpp:80
llvm::TargetRegisterClass
Definition: TargetRegisterInfo.h:45
llvm::LoongArchRegisterInfo::requiresFrameIndexScavenging
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override
Definition: LoongArchRegisterInfo.h:51
llvm::LoongArchRegisterInfo
Definition: LoongArchRegisterInfo.h:24
llvm::BitVector
Definition: BitVector.h:75
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
LoongArchGenRegisterInfo
llvm::LoongArchRegisterInfo::getFrameRegister
Register getFrameRegister(const MachineFunction &MF) const override
Definition: LoongArchRegisterInfo.cpp:113
llvm::RegScavenger
Definition: RegisterScavenging.h:34
llvm::LoongArchRegisterInfo::LoongArchRegisterInfo
LoongArchRegisterInfo(unsigned HwMode)
Definition: LoongArchRegisterInfo.cpp:32
llvm::MachineFunction
Definition: MachineFunction.h:258
uint32_t
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
uint16_t
llvm::LoongArchRegisterInfo::getReservedRegs
BitVector getReservedRegs(const MachineFunction &MF) const override
Definition: LoongArchRegisterInfo.cpp:85
llvm::MachineInstrBundleIterator< MachineInstr >
TargetRegisterInfo.h
llvm::LoongArchRegisterInfo::requiresRegisterScavenging
bool requiresRegisterScavenging(const MachineFunction &MF) const override
Definition: LoongArchRegisterInfo.h:47