LLVM  8.0.1
XCoreMachineFunctionInfo.h
Go to the documentation of this file.
1 //===- XCoreMachineFunctionInfo.h - XCore machine function info -*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares XCore-specific per-machine-function information.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
15 #define LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
16 
20 #include <cassert>
21 #include <utility>
22 #include <vector>
23 
24 namespace llvm {
25 
26 /// XCoreFunctionInfo - This class is derived from MachineFunction private
27 /// XCore target-specific information for each MachineFunction.
29  bool LRSpillSlotSet = false;
30  int LRSpillSlot;
31  bool FPSpillSlotSet = false;
32  int FPSpillSlot;
33  bool EHSpillSlotSet = false;
34  int EHSpillSlot[2];
35  unsigned ReturnStackOffset;
36  bool ReturnStackOffsetSet = false;
37  int VarArgsFrameIndex = 0;
38  mutable int CachedEStackSize = -1;
39  std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>>
40  SpillLabels;
41 
42  virtual void anchor();
43 
44 public:
45  XCoreFunctionInfo() = default;
46 
48 
49  ~XCoreFunctionInfo() override = default;
50 
51  void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
52  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
53 
55  bool hasLRSpillSlot() { return LRSpillSlotSet; }
56  int getLRSpillSlot() const {
57  assert(LRSpillSlotSet && "LR Spill slot not set");
58  return LRSpillSlot;
59  }
60 
62  bool hasFPSpillSlot() { return FPSpillSlotSet; }
63  int getFPSpillSlot() const {
64  assert(FPSpillSlotSet && "FP Spill slot not set");
65  return FPSpillSlot;
66  }
67 
68  const int* createEHSpillSlot(MachineFunction &MF);
69  bool hasEHSpillSlot() { return EHSpillSlotSet; }
70  const int* getEHSpillSlot() const {
71  assert(EHSpillSlotSet && "EH Spill slot not set");
72  return EHSpillSlot;
73  }
74 
75  void setReturnStackOffset(unsigned value) {
76  assert(!ReturnStackOffsetSet && "Return stack offset set twice");
77  ReturnStackOffset = value;
78  ReturnStackOffsetSet = true;
79  }
80 
81  unsigned getReturnStackOffset() const {
82  assert(ReturnStackOffsetSet && "Return stack offset not set");
83  return ReturnStackOffset;
84  }
85 
86  bool isLargeFrame(const MachineFunction &MF) const;
87 
88  std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>> &
90  return SpillLabels;
91  }
92 };
93 
94 } // end namespace llvm
95 
96 #endif // LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
int createLRSpillSlot(MachineFunction &MF)
This class represents lattice values for constants.
Definition: AllocatorList.h:24
~XCoreFunctionInfo() override=default
std::vector< std::pair< MachineBasicBlock::iterator, CalleeSavedInfo > > & getSpillLabels()
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
void setReturnStackOffset(unsigned value)
int createFPSpillSlot(MachineFunction &MF)
const int * createEHSpillSlot(MachineFunction &MF)
XCoreFunctionInfo - This class is derived from MachineFunction private XCore target-specific informat...
XCoreFunctionInfo(MachineFunction &MF)
const int * getEHSpillSlot() const
bool isLargeFrame(const MachineFunction &MF) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())