LLVM  13.0.0git
ARCFrameLowering.h
Go to the documentation of this file.
1 //===- ARCFrameLowering.h - Define frame lowering for ARC -------*- 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 the ARC specific frame lowering.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_ARC_ARCFRAMELOWERING_H
14 #define LLVM_LIB_TARGET_ARC_ARCFRAMELOWERING_H
15 
16 #include "ARC.h"
20 
21 namespace llvm {
22 
23 class MachineFunction;
24 class ARCSubtarget;
25 class ARCInstrInfo;
26 
28 public:
31  ST(st) {}
32 
33  /// Insert Prologue into the function.
34  void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
35 
36  /// Insert Epilogue into the function.
37  void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
38 
39  /// Add explicit callee save registers.
40  void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
41  RegScavenger *RS) const override;
42 
46  const TargetRegisterInfo *TRI) const override;
47 
48  bool
52  const TargetRegisterInfo *TRI) const override;
53 
55  RegScavenger *RS) const override;
56 
57  bool hasFP(const MachineFunction &MF) const override;
58 
61  MachineBasicBlock::iterator I) const override;
62 
65  std::vector<llvm::CalleeSavedInfo> &) const override;
66 
67 private:
68  void adjustStackToMatchRecords(MachineBasicBlock &MBB,
70  bool allocate) const;
71 
72  const ARCSubtarget &ST;
73 };
74 
75 } // end namespace llvm
76 
77 #endif // LLVM_LIB_TARGET_ARC_ARCFRAMELOWERING_H
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:100
llvm
Definition: AllocatorList.h:23
llvm::ARCFrameLowering::emitPrologue
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
Insert Prologue into the function.
Definition: ARCFrameLowering.cpp:115
TargetFrameLowering.h
llvm::TargetFrameLowering
Information about stack frame layout on the target.
Definition: TargetFrameLowering.h:42
MachineBasicBlock.h
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:231
llvm::ARCFrameLowering::hasFP
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register.
Definition: ARCFrameLowering.cpp:491
llvm::ARCFrameLowering::restoreCalleeSavedRegisters
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, MutableArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns...
Definition: ARCFrameLowering.cpp:418
TRI
unsigned const TargetRegisterInfo * TRI
Definition: MachineSink.cpp:1567
llvm::ARCFrameLowering
Definition: ARCFrameLowering.h:27
llvm::MutableArrayRef
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Definition: ArrayRef.h:305
llvm::ARCSubtarget
Definition: ARCSubtarget.h:31
llvm::ARCFrameLowering::assignCalleeSavedSpillSlots
bool assignCalleeSavedSpillSlots(llvm::MachineFunction &, const llvm::TargetRegisterInfo *, std::vector< llvm::CalleeSavedInfo > &) const override
assignCalleeSavedSpillSlots - Allows target to override spill slot assignment logic.
Definition: ARCFrameLowering.cpp:345
llvm::BitVector
Definition: BitVector.h:74
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::ARCFrameLowering::ARCFrameLowering
ARCFrameLowering(const ARCSubtarget &st)
Definition: ARCFrameLowering.h:29
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::ARCFrameLowering::spillCalleeSavedRegisters
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, ArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns tru...
Definition: ARCFrameLowering.cpp:401
llvm::ARCFrameLowering::processFunctionBeforeFrameFinalized
void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS) const override
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function...
Definition: ARCFrameLowering.cpp:433
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::RegScavenger
Definition: RegisterScavenging.h:34
llvm::ARCFrameLowering::emitEpilogue
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
Insert Epilogue into the function.
Definition: ARCFrameLowering.cpp:239
llvm::MachineFunction
Definition: MachineFunction.h:227
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::ARCFrameLowering::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: ARCFrameLowering.cpp:467
MachineFrameInfo.h
ARC.h
llvm::TargetFrameLowering::StackGrowsDown
@ StackGrowsDown
Definition: TargetFrameLowering.h:46
llvm::ARCFrameLowering::determineCalleeSaves
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS) const override
Add explicit callee save registers.
Definition: ARCFrameLowering.cpp:88
llvm::MachineInstrBundleIterator< MachineInstr >