1 //=- LoongArchInstrInfo.h - LoongArch Instruction Information ---*- 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 TargetInstrInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_LOONGARCH_LOONGARCHINSTRINFO_H
14 #define LLVM_LIB_TARGET_LOONGARCH_LOONGARCHINSTRINFO_H
15 
16 #include "LoongArchRegisterInfo.h"
17 #include "llvm/CodeGen/TargetInstrInfo.h"
18 
19 #define GET_INSTRINFO_HEADER
20 #include "LoongArchGenInstrInfo.inc"
21 
22 namespace llvm {
23 
24 class LoongArchSubtarget;
25 
26 class LoongArchInstrInfo : public LoongArchGenInstrInfo {
27 public:
28   explicit LoongArchInstrInfo(LoongArchSubtarget &STI);
29 
30   void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
31                    const DebugLoc &DL, MCRegister DstReg, MCRegister SrcReg,
32                    bool KillSrc) const override;
33 
34   void storeRegToStackSlot(MachineBasicBlock &MBB,
35                            MachineBasicBlock::iterator MBBI, Register SrcReg,
36                            bool IsKill, int FrameIndex,
37                            const TargetRegisterClass *RC,
38                            const TargetRegisterInfo *TRI) const override;
39   void loadRegFromStackSlot(MachineBasicBlock &MBB,
40                             MachineBasicBlock::iterator MBBI, Register DstReg,
41                             int FrameIndex, const TargetRegisterClass *RC,
42                             const TargetRegisterInfo *TRI) const override;
43 };
44 
45 } // end namespace llvm
46 #endif // LLVM_LIB_TARGET_LOONGARCH_LOONGARCHINSTRINFO_H
47