Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / MSP430 / MSP430FrameLowering.h
blob5227d3e731edb3f9648044d9e81dc7834eee763d
1 //==- MSP430FrameLowering.h - Define frame lowering for MSP430 --*- 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 //
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_MSP430_MSP430FRAMELOWERING_H
14 #define LLVM_LIB_TARGET_MSP430_MSP430FRAMELOWERING_H
16 #include "MSP430.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
19 namespace llvm {
21 class MSP430Subtarget;
22 class MSP430InstrInfo;
23 class MSP430RegisterInfo;
25 class MSP430FrameLowering : public TargetFrameLowering {
26 protected:
28 public:
29 MSP430FrameLowering(const MSP430Subtarget &STI);
31 const MSP430Subtarget &STI;
32 const MSP430InstrInfo &TII;
33 const MSP430RegisterInfo *TRI;
35 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
36 /// the function.
37 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
38 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
40 MachineBasicBlock::iterator
41 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
42 MachineBasicBlock::iterator I) const override;
44 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
45 MachineBasicBlock::iterator MI,
46 ArrayRef<CalleeSavedInfo> CSI,
47 const TargetRegisterInfo *TRI) const override;
48 bool
49 restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
50 MachineBasicBlock::iterator MI,
51 MutableArrayRef<CalleeSavedInfo> CSI,
52 const TargetRegisterInfo *TRI) const override;
54 bool hasFP(const MachineFunction &MF) const override;
55 bool hasReservedCallFrame(const MachineFunction &MF) const override;
56 void processFunctionBeforeFrameFinalized(MachineFunction &MF,
57 RegScavenger *RS = nullptr) const override;
59 /// Wraps up getting a CFI index and building a MachineInstr for it.
60 void BuildCFI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
61 const DebugLoc &DL, const MCCFIInstruction &CFIInst,
62 MachineInstr::MIFlag Flag = MachineInstr::NoFlags) const;
64 void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
65 MachineBasicBlock::iterator MBBI,
66 const DebugLoc &DL, bool IsPrologue) const;
69 } // End llvm namespace
71 #endif