Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / Lanai / LanaiFrameLowering.h
blob380d63df7301ef53721402a3a3659fd58020db45
1 //===-- LanaiFrameLowering.h - Define frame lowering for Lanai --*- 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 class implements Lanai-specific bits of TargetFrameLowering class.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_LANAI_LANAIFRAMELOWERING_H
14 #define LLVM_LIB_TARGET_LANAI_LANAIFRAMELOWERING_H
16 #include "llvm/CodeGen/TargetFrameLowering.h"
18 namespace llvm {
20 class BitVector;
21 class LanaiSubtarget;
23 class LanaiFrameLowering : public TargetFrameLowering {
24 private:
25 void determineFrameLayout(MachineFunction &MF) const;
26 void replaceAdjDynAllocPseudo(MachineFunction &MF) const;
28 protected:
29 const LanaiSubtarget &STI;
31 public:
32 explicit LanaiFrameLowering(const LanaiSubtarget &Subtarget)
33 : TargetFrameLowering(StackGrowsDown,
34 /*StackAlignment=*/Align(8),
35 /*LocalAreaOffset=*/0),
36 STI(Subtarget) {}
38 // emitProlog/emitEpilog - These methods insert prolog and epilog code into
39 // the function.
40 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
41 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
43 MachineBasicBlock::iterator
44 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
45 MachineBasicBlock::iterator I) const override;
47 bool hasFP(const MachineFunction & /*MF*/) const override { return true; }
49 void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
50 RegScavenger *RS = nullptr) const override;
53 } // namespace llvm
55 #endif // LLVM_LIB_TARGET_LANAI_LANAIFRAMELOWERING_H