LLVM  14.0.0git
SparcFrameLowering.h
Go to the documentation of this file.
1 //===-- SparcFrameLowering.h - Define frame lowering for Sparc --*- 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 //
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H
14 #define LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H
15 
16 #include "Sparc.h"
18 #include "llvm/Support/TypeSize.h"
19 
20 namespace llvm {
21 
22 class SparcSubtarget;
24 public:
25  explicit SparcFrameLowering(const SparcSubtarget &ST);
26 
27  /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
28  /// the function.
29  void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
30  void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
31 
35  MachineBasicBlock::iterator I) const override;
36 
37  bool hasReservedCallFrame(const MachineFunction &MF) const override;
38  bool hasFP(const MachineFunction &MF) const override;
39  void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
40  RegScavenger *RS = nullptr) const override;
41 
43  Register &FrameReg) const override;
44 
45  /// targetHandlesStackFrameRounding - Returns true if the target is
46  /// responsible for rounding up the stack frame (probably at emitPrologue
47  /// time).
48  bool targetHandlesStackFrameRounding() const override { return true; }
49 
50 private:
51  // Remap input registers to output registers for leaf procedure.
52  void remapRegsForLeafProc(MachineFunction &MF) const;
53 
54  // Returns true if MF is a leaf procedure.
55  bool isLeafProc(MachineFunction &MF) const;
56 
57 
58  // Emits code for adjusting SP in function prologue/epilogue.
59  void emitSPAdjustment(MachineFunction &MF,
62  int NumBytes, unsigned ADDrr, unsigned ADDri) const;
63 
64 };
65 
66 } // End llvm namespace
67 
68 #endif
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
TargetFrameLowering.h
llvm::TargetFrameLowering
Information about stack frame layout on the target.
Definition: TargetFrameLowering.h:43
TypeSize.h
llvm::SparcFrameLowering::determineCalleeSaves
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const override
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
Definition: SparcFrameLowering.cpp:368
llvm::SparcFrameLowering::getFrameIndexReference
StackOffset getFrameIndexReference(const MachineFunction &MF, int FI, Register &FrameReg) const override
getFrameIndexReference - This method should return the base register and offset used to reference a f...
Definition: SparcFrameLowering.cpp:255
llvm::SparcFrameLowering::hasReservedCallFrame
bool hasReservedCallFrame(const MachineFunction &MF) const override
hasReservedCallFrame - Under normal circumstances, when a frame pointer is not required,...
Definition: SparcFrameLowering.cpp:237
llvm::SparcFrameLowering::eliminateCallFramePseudoInstr
MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override
This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy p...
Definition: SparcFrameLowering.cpp:199
llvm::SparcFrameLowering
Definition: SparcFrameLowering.h:23
llvm::SparcFrameLowering::emitEpilogue
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
Definition: SparcFrameLowering.cpp:214
llvm::BitVector
Definition: BitVector.h:74
llvm::SparcSubtarget
Definition: SparcSubtarget.h:31
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::ARM_MB::ST
@ ST
Definition: ARMBaseInfo.h:73
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::RegScavenger
Definition: RegisterScavenging.h:34
llvm::MachineFunction
Definition: MachineFunction.h:234
MBBI
MachineBasicBlock MachineBasicBlock::iterator MBBI
Definition: AArch64SLSHardening.cpp:75
llvm::StackOffset
StackOffset is a class to represent an offset with 2 dimensions, named fixed and scalable,...
Definition: TypeSize.h:134
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::SparcFrameLowering::hasFP
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register.
Definition: SparcFrameLowering.cpp:245
llvm::SparcFrameLowering::SparcFrameLowering
SparcFrameLowering(const SparcSubtarget &ST)
Definition: SparcFrameLowering.cpp:35
Sparc.h
llvm::SparcFrameLowering::targetHandlesStackFrameRounding
bool targetHandlesStackFrameRounding() const override
targetHandlesStackFrameRounding - Returns true if the target is responsible for rounding up the stack...
Definition: SparcFrameLowering.h:48
llvm::SparcFrameLowering::emitPrologue
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Definition: SparcFrameLowering.cpp:85
llvm::MachineInstrBundleIterator< MachineInstr >