LLVM 20.0.0git
XCoreMachineFunctionInfo.h
Go to the documentation of this file.
1//===- XCoreMachineFunctionInfo.h - XCore machine function info -*- 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 declares XCore-specific per-machine-function information.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
14#define LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
15
19#include <cassert>
20#include <utility>
21#include <vector>
22
23namespace llvm {
24
25/// XCoreFunctionInfo - This class is derived from MachineFunction private
26/// XCore target-specific information for each MachineFunction.
28 bool LRSpillSlotSet = false;
29 int LRSpillSlot;
30 bool FPSpillSlotSet = false;
31 int FPSpillSlot;
32 bool EHSpillSlotSet = false;
33 int EHSpillSlot[2];
34 unsigned ReturnStackOffset;
35 bool ReturnStackOffsetSet = false;
36 int VarArgsFrameIndex = 0;
37 mutable int CachedEStackSize = -1;
38 std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>>
39 SpillLabels;
40
41 virtual void anchor();
42
43public:
44 XCoreFunctionInfo() = default;
45
46 explicit XCoreFunctionInfo(const Function &F,
47 const TargetSubtargetInfo *STI) {}
48
52 const override;
53
54 ~XCoreFunctionInfo() override = default;
55
56 void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
57 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
58
60 bool hasLRSpillSlot() { return LRSpillSlotSet; }
61 int getLRSpillSlot() const {
62 assert(LRSpillSlotSet && "LR Spill slot not set");
63 return LRSpillSlot;
64 }
65
67 bool hasFPSpillSlot() { return FPSpillSlotSet; }
68 int getFPSpillSlot() const {
69 assert(FPSpillSlotSet && "FP Spill slot not set");
70 return FPSpillSlot;
71 }
72
73 const int* createEHSpillSlot(MachineFunction &MF);
74 bool hasEHSpillSlot() { return EHSpillSlotSet; }
75 const int* getEHSpillSlot() const {
76 assert(EHSpillSlotSet && "EH Spill slot not set");
77 return EHSpillSlot;
78 }
79
80 void setReturnStackOffset(unsigned value) {
81 assert(!ReturnStackOffsetSet && "Return stack offset set twice");
82 ReturnStackOffset = value;
83 ReturnStackOffsetSet = true;
84 }
85
86 unsigned getReturnStackOffset() const {
87 assert(ReturnStackOffsetSet && "Return stack offset not set");
88 return ReturnStackOffset;
89 }
90
91 bool isLargeFrame(const MachineFunction &MF) const;
92
93 std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>> &
95 return SpillLabels;
96 }
97};
98
99} // end namespace llvm
100
101#endif // LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
Given that RA is a live value
#define F(x, y, z)
Definition: MD5.cpp:55
Basic Register Allocator
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:66
TargetSubtargetInfo - Generic base class for all target subtargets.
XCoreFunctionInfo - This class is derived from MachineFunction private XCore target-specific informat...
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
~XCoreFunctionInfo() override=default
const int * getEHSpillSlot() const
const int * createEHSpillSlot(MachineFunction &MF)
void setReturnStackOffset(unsigned value)
bool isLargeFrame(const MachineFunction &MF) const
int createLRSpillSlot(MachineFunction &MF)
int createFPSpillSlot(MachineFunction &MF)
std::vector< std::pair< MachineBasicBlock::iterator, CalleeSavedInfo > > & getSpillLabels()
XCoreFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...