Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / AVR / AVRRegisterInfo.h
blob8eb0cf3039bbd44ffd4734c085a3e06df77e3705
1 //===-- AVRRegisterInfo.h - AVR 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 AVR implementation of the TargetRegisterInfo class.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_AVR_REGISTER_INFO_H
14 #define LLVM_AVR_REGISTER_INFO_H
16 #include "llvm/CodeGen/TargetRegisterInfo.h"
18 #define GET_REGINFO_HEADER
19 #include "AVRGenRegisterInfo.inc"
21 namespace llvm {
23 /// Utilities relating to AVR registers.
24 class AVRRegisterInfo : public AVRGenRegisterInfo {
25 public:
26 AVRRegisterInfo();
28 public:
29 const uint16_t *
30 getCalleeSavedRegs(const MachineFunction *MF = nullptr) const override;
31 const uint32_t *getCallPreservedMask(const MachineFunction &MF,
32 CallingConv::ID CC) const override;
33 BitVector getReservedRegs(const MachineFunction &MF) const override;
35 const TargetRegisterClass *
36 getLargestLegalSuperClass(const TargetRegisterClass *RC,
37 const MachineFunction &MF) const override;
39 /// Stack Frame Processing Methods
40 bool eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
41 unsigned FIOperandNum,
42 RegScavenger *RS = nullptr) const override;
44 Register getFrameRegister(const MachineFunction &MF) const override;
46 const TargetRegisterClass *
47 getPointerRegClass(const MachineFunction &MF,
48 unsigned Kind = 0) const override;
50 /// Splits a 16-bit `DREGS` register into the lo/hi register pair.
51 /// \param Reg A 16-bit register to split.
52 void splitReg(Register Reg, Register &LoReg, Register &HiReg) const;
54 bool shouldCoalesce(MachineInstr *MI, const TargetRegisterClass *SrcRC,
55 unsigned SubReg, const TargetRegisterClass *DstRC,
56 unsigned DstSubReg, const TargetRegisterClass *NewRC,
57 LiveIntervals &LIS) const override;
60 } // end namespace llvm
62 #endif // LLVM_AVR_REGISTER_INFO_H