LLVM  13.0.0git
WebAssemblyFrameLowering.cpp
Go to the documentation of this file.
1 //===-- WebAssemblyFrameLowering.cpp - WebAssembly Frame Lowering ----------==//
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 /// \file
10 /// This file contains the WebAssembly implementation of
11 /// TargetFrameLowering class.
12 ///
13 /// On WebAssembly, there aren't a lot of things to do here. There are no
14 /// callee-saved registers to save, and no spill slots.
15 ///
16 /// The stack grows downward.
17 ///
18 //===----------------------------------------------------------------------===//
19 
22 #include "WebAssembly.h"
23 #include "WebAssemblyInstrInfo.h"
25 #include "WebAssemblySubtarget.h"
27 #include "WebAssemblyUtilities.h"
33 #include "llvm/MC/MCAsmInfo.h"
34 #include "llvm/Support/Debug.h"
35 using namespace llvm;
36 
37 #define DEBUG_TYPE "wasm-frame-info"
38 
39 // TODO: wasm64
40 // TODO: Emit TargetOpcode::CFI_INSTRUCTION instructions
41 
42 /// We need a base pointer in the case of having items on the stack that
43 /// require stricter alignment than the stack pointer itself. Because we need
44 /// to shift the stack pointer by some unknown amount to force the alignment,
45 /// we need to record the value of the stack pointer on entry to the function.
46 bool WebAssemblyFrameLowering::hasBP(const MachineFunction &MF) const {
47  const auto *RegInfo =
48  MF.getSubtarget<WebAssemblySubtarget>().getRegisterInfo();
49  return RegInfo->hasStackRealignment(MF);
50 }
51 
52 /// Return true if the specified function should have a dedicated frame pointer
53 /// register.
55  const MachineFrameInfo &MFI = MF.getFrameInfo();
56 
57  // When we have var-sized objects, we move the stack pointer by an unknown
58  // amount, and need to emit a frame pointer to restore the stack to where we
59  // were on function entry.
60  // If we already need a base pointer, we use that to fix up the stack pointer.
61  // If there are no fixed-size objects, we would have no use of a frame
62  // pointer, and thus should not emit one.
63  bool HasFixedSizedObjects = MFI.getStackSize() > 0;
64  bool NeedsFixedReference = !hasBP(MF) || HasFixedSizedObjects;
65 
66  return MFI.isFrameAddressTaken() ||
67  (MFI.hasVarSizedObjects() && NeedsFixedReference) ||
68  MFI.hasStackMap() || MFI.hasPatchPoint();
69 }
70 
71 /// Under normal circumstances, when a frame pointer is not required, we reserve
72 /// argument space for call sites in the function immediately on entry to the
73 /// current function. This eliminates the need for add/sub sp brackets around
74 /// call sites. Returns true if the call frame is included as part of the stack
75 /// frame.
77  const MachineFunction &MF) const {
78  return !MF.getFrameInfo().hasVarSizedObjects();
79 }
80 
81 // Returns true if this function needs a local user-space stack pointer for its
82 // local frame (not for exception handling).
83 bool WebAssemblyFrameLowering::needsSPForLocalFrame(
84  const MachineFunction &MF) const {
85  auto &MFI = MF.getFrameInfo();
86  return MFI.getStackSize() || MFI.adjustsStack() || hasFP(MF);
87 }
88 
89 // In function with EH pads, we need to make a copy of the value of
90 // __stack_pointer global in SP32/64 register, in order to use it when
91 // restoring __stack_pointer after an exception is caught.
93  const MachineFunction &MF) const {
94  auto EHType = MF.getTarget().getMCAsmInfo()->getExceptionHandlingType();
95  return EHType == ExceptionHandling::Wasm &&
97 }
98 
99 /// Returns true if this function needs a local user-space stack pointer.
100 /// Unlike a machine stack pointer, the wasm user stack pointer is a global
101 /// variable, so it is loaded into a register in the prolog.
102 bool WebAssemblyFrameLowering::needsSP(const MachineFunction &MF) const {
103  return needsSPForLocalFrame(MF) || needsPrologForEH(MF);
104 }
105 
106 /// Returns true if the local user-space stack pointer needs to be written back
107 /// to __stack_pointer global by this function (this is not meaningful if
108 /// needsSP is false). If false, the stack red zone can be used and only a local
109 /// SP is needed.
110 bool WebAssemblyFrameLowering::needsSPWriteback(
111  const MachineFunction &MF) const {
112  auto &MFI = MF.getFrameInfo();
113  assert(needsSP(MF));
114  // When we don't need a local stack pointer for its local frame but only to
115  // support EH, we don't need to write SP back in the epilog, because we don't
116  // bump down the stack pointer in the prolog. We need to write SP back in the
117  // epilog only if
118  // 1. We need SP not only for EH support but also because we actually use
119  // stack or we have a frame address taken.
120  // 2. We cannot use the red zone.
121  bool CanUseRedZone = MFI.getStackSize() <= RedZoneSize && !MFI.hasCalls() &&
122  !MF.getFunction().hasFnAttribute(Attribute::NoRedZone);
123  return needsSPForLocalFrame(MF) && !CanUseRedZone;
124 }
125 
127  return MF.getSubtarget<WebAssemblySubtarget>().hasAddr64()
128  ? WebAssembly::SP64
129  : WebAssembly::SP32;
130 }
131 
133  return MF.getSubtarget<WebAssemblySubtarget>().hasAddr64()
134  ? WebAssembly::FP64
135  : WebAssembly::FP32;
136 }
137 
138 unsigned
140  return MF.getSubtarget<WebAssemblySubtarget>().hasAddr64()
141  ? WebAssembly::CONST_I64
142  : WebAssembly::CONST_I32;
143 }
144 
146  return MF.getSubtarget<WebAssemblySubtarget>().hasAddr64()
147  ? WebAssembly::ADD_I64
148  : WebAssembly::ADD_I32;
149 }
150 
152  return MF.getSubtarget<WebAssemblySubtarget>().hasAddr64()
153  ? WebAssembly::SUB_I64
154  : WebAssembly::SUB_I32;
155 }
156 
158  return MF.getSubtarget<WebAssemblySubtarget>().hasAddr64()
159  ? WebAssembly::AND_I64
160  : WebAssembly::AND_I32;
161 }
162 
163 unsigned
165  return MF.getSubtarget<WebAssemblySubtarget>().hasAddr64()
166  ? WebAssembly::GLOBAL_GET_I64
167  : WebAssembly::GLOBAL_GET_I32;
168 }
169 
170 unsigned
172  return MF.getSubtarget<WebAssemblySubtarget>().hasAddr64()
173  ? WebAssembly::GLOBAL_SET_I64
174  : WebAssembly::GLOBAL_SET_I32;
175 }
176 
178  unsigned SrcReg, MachineFunction &MF, MachineBasicBlock &MBB,
179  MachineBasicBlock::iterator &InsertStore, const DebugLoc &DL) const {
180  const auto *TII = MF.getSubtarget<WebAssemblySubtarget>().getInstrInfo();
181 
182  const char *ES = "__stack_pointer";
183  auto *SPSymbol = MF.createExternalSymbolName(ES);
184 
185  BuildMI(MBB, InsertStore, DL, TII->get(getOpcGlobSet(MF)))
186  .addExternalSymbol(SPSymbol)
187  .addReg(SrcReg);
188 }
189 
194  assert(!I->getOperand(0).getImm() && (hasFP(MF) || hasBP(MF)) &&
195  "Call frame pseudos should only be used for dynamic stack adjustment");
196  auto &ST = MF.getSubtarget<WebAssemblySubtarget>();
197  const auto *TII = ST.getInstrInfo();
198  if (I->getOpcode() == TII->getCallFrameDestroyOpcode() &&
199  needsSPWriteback(MF)) {
200  DebugLoc DL = I->getDebugLoc();
201  writeSPToGlobal(getSPReg(MF), MF, MBB, I, DL);
202  }
203  return MBB.erase(I);
204 }
205 
207  MachineBasicBlock &MBB) const {
208  // TODO: Do ".setMIFlag(MachineInstr::FrameSetup)" on emitted instructions
209  auto &MFI = MF.getFrameInfo();
210  assert(MFI.getCalleeSavedInfo().empty() &&
211  "WebAssembly should not have callee-saved registers");
212 
213  if (!needsSP(MF))
214  return;
215  uint64_t StackSize = MFI.getStackSize();
216 
217  auto &ST = MF.getSubtarget<WebAssemblySubtarget>();
218  const auto *TII = ST.getInstrInfo();
219  auto &MRI = MF.getRegInfo();
220 
221  auto InsertPt = MBB.begin();
222  while (InsertPt != MBB.end() &&
223  WebAssembly::isArgument(InsertPt->getOpcode()))
224  ++InsertPt;
225  DebugLoc DL;
226 
227  const TargetRegisterClass *PtrRC =
229  unsigned SPReg = getSPReg(MF);
230  if (StackSize)
231  SPReg = MRI.createVirtualRegister(PtrRC);
232 
233  const char *ES = "__stack_pointer";
234  auto *SPSymbol = MF.createExternalSymbolName(ES);
235  BuildMI(MBB, InsertPt, DL, TII->get(getOpcGlobGet(MF)), SPReg)
236  .addExternalSymbol(SPSymbol);
237 
238  bool HasBP = hasBP(MF);
239  if (HasBP) {
240  auto FI = MF.getInfo<WebAssemblyFunctionInfo>();
241  Register BasePtr = MRI.createVirtualRegister(PtrRC);
242  FI->setBasePointerVreg(BasePtr);
243  BuildMI(MBB, InsertPt, DL, TII->get(WebAssembly::COPY), BasePtr)
244  .addReg(SPReg);
245  }
246  if (StackSize) {
247  // Subtract the frame size
248  Register OffsetReg = MRI.createVirtualRegister(PtrRC);
249  BuildMI(MBB, InsertPt, DL, TII->get(getOpcConst(MF)), OffsetReg)
250  .addImm(StackSize);
251  BuildMI(MBB, InsertPt, DL, TII->get(getOpcSub(MF)), getSPReg(MF))
252  .addReg(SPReg)
253  .addReg(OffsetReg);
254  }
255  if (HasBP) {
256  Register BitmaskReg = MRI.createVirtualRegister(PtrRC);
257  Align Alignment = MFI.getMaxAlign();
258  BuildMI(MBB, InsertPt, DL, TII->get(getOpcConst(MF)), BitmaskReg)
259  .addImm((int64_t) ~(Alignment.value() - 1));
260  BuildMI(MBB, InsertPt, DL, TII->get(getOpcAnd(MF)), getSPReg(MF))
261  .addReg(getSPReg(MF))
262  .addReg(BitmaskReg);
263  }
264  if (hasFP(MF)) {
265  // Unlike most conventional targets (where FP points to the saved FP),
266  // FP points to the bottom of the fixed-size locals, so we can use positive
267  // offsets in load/store instructions.
268  BuildMI(MBB, InsertPt, DL, TII->get(WebAssembly::COPY), getFPReg(MF))
269  .addReg(getSPReg(MF));
270  }
271  if (StackSize && needsSPWriteback(MF)) {
272  writeSPToGlobal(getSPReg(MF), MF, MBB, InsertPt, DL);
273  }
274 }
275 
277  MachineBasicBlock &MBB) const {
278  uint64_t StackSize = MF.getFrameInfo().getStackSize();
279  if (!needsSP(MF) || !needsSPWriteback(MF))
280  return;
281  auto &ST = MF.getSubtarget<WebAssemblySubtarget>();
282  const auto *TII = ST.getInstrInfo();
283  auto &MRI = MF.getRegInfo();
284  auto InsertPt = MBB.getFirstTerminator();
285  DebugLoc DL;
286 
287  if (InsertPt != MBB.end())
288  DL = InsertPt->getDebugLoc();
289 
290  // Restore the stack pointer. If we had fixed-size locals, add the offset
291  // subtracted in the prolog.
292  unsigned SPReg = 0;
293  unsigned SPFPReg = hasFP(MF) ? getFPReg(MF) : getSPReg(MF);
294  if (hasBP(MF)) {
295  auto FI = MF.getInfo<WebAssemblyFunctionInfo>();
296  SPReg = FI->getBasePointerVreg();
297  } else if (StackSize) {
298  const TargetRegisterClass *PtrRC =
300  Register OffsetReg = MRI.createVirtualRegister(PtrRC);
301  BuildMI(MBB, InsertPt, DL, TII->get(getOpcConst(MF)), OffsetReg)
302  .addImm(StackSize);
303  // In the epilog we don't need to write the result back to the SP32/64
304  // physreg because it won't be used again. We can use a stackified register
305  // instead.
306  SPReg = MRI.createVirtualRegister(PtrRC);
307  BuildMI(MBB, InsertPt, DL, TII->get(getOpcAdd(MF)), SPReg)
308  .addReg(SPFPReg)
309  .addReg(OffsetReg);
310  } else {
311  SPReg = SPFPReg;
312  }
313 
314  writeSPToGlobal(SPReg, MF, MBB, InsertPt, DL);
315 }
316 
319  DwarfFrameBase Loc;
322  if (needsSP(MF) && MFI.isFrameBaseVirtual()) {
323  unsigned LocalNum = MFI.getFrameBaseLocal();
325  } else {
326  // TODO: This should work on a breakpoint at a function with no frame,
327  // but probably won't work for traversing up the stack.
329  }
330  return Loc;
331 }
llvm::WebAssemblyFrameLowering::getOpcAdd
static unsigned getOpcAdd(const MachineFunction &MF)
Definition: WebAssemblyFrameLowering.cpp:145
llvm::MachineFrameInfo::hasVarSizedObjects
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
Definition: MachineFrameInfo.h:351
MachineModuleInfoImpls.h
llvm::WebAssembly::isArgument
bool isArgument(unsigned Opc)
Definition: WebAssemblyMCTargetDesc.h:302
llvm::MachineInstrBuilder::addImm
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Definition: MachineInstrBuilder.h:132
llvm
Definition: AllocatorList.h:23
llvm::WebAssemblyFrameLowering::getSPReg
static unsigned getSPReg(const MachineFunction &MF)
Definition: WebAssemblyFrameLowering.cpp:126
WebAssembly.h
llvm::MachineRegisterInfo::createVirtualRegister
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
Definition: MachineRegisterInfo.cpp:158
llvm::WebAssemblyFrameLowering::getOpcSub
static unsigned getOpcSub(const MachineFunction &MF)
Definition: WebAssemblyFrameLowering.cpp:151
llvm::LocalNum
LocalNum
Definition: PredicateInfo.cpp:87
llvm::MachineRegisterInfo::getTargetRegisterInfo
const TargetRegisterInfo * getTargetRegisterInfo() const
Definition: MachineRegisterInfo.h:153
llvm::Function::hasFnAttribute
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition: Function.h:345
llvm::TargetFrameLowering::DwarfFrameBase
Definition: TargetFrameLowering.h:55
WebAssemblyTargetMachine.h
llvm::WebAssemblyFrameLowering::writeSPToGlobal
void writeSPToGlobal(unsigned SrcReg, MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator &InsertStore, const DebugLoc &DL) const
Write SP back to __stack_pointer global.
Definition: WebAssemblyFrameLowering.cpp:177
llvm::WebAssemblyFrameLowering::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: WebAssemblyFrameLowering.cpp:191
MachineRegisterInfo.h
llvm::MachineBasicBlock::erase
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
Definition: MachineBasicBlock.cpp:1322
llvm::TargetFrameLowering::DwarfFrameBase::WasmLoc
struct WasmFrameBase WasmLoc
Definition: TargetFrameLowering.h:65
llvm::MachineFunction::getRegInfo
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Definition: MachineFunction.h:565
llvm::WebAssemblyFrameLowering::emitPrologue
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
These methods insert prolog and epilog code into the function.
Definition: WebAssemblyFrameLowering.cpp:206
llvm::WebAssemblyFunctionInfo::getBasePointerVreg
unsigned getBasePointerVreg() const
Definition: WebAssemblyMachineFunctionInfo.h:103
llvm::MachineFunction::getInfo
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Definition: MachineFunction.h:653
llvm::TargetRegisterClass
Definition: TargetRegisterInfo.h:46
llvm::WebAssemblyFrameLowering::getOpcConst
static unsigned getOpcConst(const MachineFunction &MF)
Definition: WebAssemblyFrameLowering.cpp:139
WebAssemblyInstrInfo.h
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:129
llvm::ExceptionHandling::Wasm
@ Wasm
WebAssembly Exception Handling.
llvm::Function::hasPersonalityFn
bool hasPersonalityFn() const
Check whether this function has a personality function.
Definition: Function.h:820
llvm::MachineFrameInfo::getStackSize
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
Definition: MachineFrameInfo.h:563
llvm::TargetFrameLowering::DwarfFrameBase::WasmFrameBase
@ WasmFrameBase
Definition: TargetFrameLowering.h:58
llvm::TargetFrameLowering::DwarfFrameBase::Kind
enum llvm::TargetFrameLowering::DwarfFrameBase::FrameBaseKind Kind
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::MachineInstrBuilder::addExternalSymbol
const MachineInstrBuilder & addExternalSymbol(const char *FnName, unsigned TargetFlags=0) const
Definition: MachineInstrBuilder.h:185
llvm::WebAssembly::TI_GLOBAL_RELOC
@ TI_GLOBAL_RELOC
Definition: WebAssembly.h:94
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
WebAssemblyUtilities.h
llvm::WebAssemblyFrameLowering::getOpcGlobSet
static unsigned getOpcGlobSet(const MachineFunction &MF)
Definition: WebAssemblyFrameLowering.cpp:171
WebAssemblyMCTargetDesc.h
llvm::TargetRegisterInfo::getPointerRegClass
virtual const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const
Returns a TargetRegisterClass used for pointer values.
Definition: TargetRegisterInfo.h:743
llvm::WebAssemblyFrameLowering::getDwarfFrameBase
DwarfFrameBase getDwarfFrameBase(const MachineFunction &MF) const override
Return the frame base information to be encoded in the DWARF subprogram debug info.
Definition: WebAssemblyFrameLowering.cpp:318
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:555
WebAssemblyFrameLowering.h
llvm::ARM_MB::ST
@ ST
Definition: ARMBaseInfo.h:73
I
#define I(x, y, z)
Definition: MD5.cpp:59
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MachineFunction::getFrameInfo
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Definition: MachineFunction.h:571
llvm::WebAssemblyFunctionInfo
This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...
Definition: WebAssemblyMachineFunctionInfo.h:33
llvm::MachineInstrBuilder::addReg
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Definition: MachineInstrBuilder.h:98
WebAssemblyMachineFunctionInfo.h
llvm::MachineFunction
Definition: MachineFunction.h:227
llvm::MachineBasicBlock::getFirstTerminator
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
Definition: MachineBasicBlock.cpp:239
llvm::TargetMachine::getMCAsmInfo
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
Definition: TargetMachine.h:202
llvm::MachineFrameInfo::hasPatchPoint
bool hasPatchPoint() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition: MachineFrameInfo.h:384
MCAsmInfo.h
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::WebAssemblyFrameLowering::emitEpilogue
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
Definition: WebAssemblyFrameLowering.cpp:276
llvm::WebAssemblySubtarget
Definition: WebAssemblySubtarget.h:35
llvm::WebAssemblyFrameLowering::getOpcAnd
static unsigned getOpcAnd(const MachineFunction &MF)
Definition: WebAssemblyFrameLowering.cpp:157
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::MachineFrameInfo::isFrameAddressTaken
bool isFrameAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition: MachineFrameInfo.h:366
llvm::MachineFrameInfo::hasCalls
bool hasCalls() const
Return true if the current function has any function calls.
Definition: MachineFrameInfo.h:602
llvm::WebAssemblyFrameLowering::hasReservedCallFrame
bool hasReservedCallFrame(const MachineFunction &MF) const override
Under normal circumstances, when a frame pointer is not required, we reserve argument space for call ...
Definition: WebAssemblyFrameLowering.cpp:76
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::WebAssemblyFrameLowering::getFPReg
static unsigned getFPReg(const MachineFunction &MF)
Definition: WebAssemblyFrameLowering.cpp:132
llvm::WebAssembly::TI_LOCAL
@ TI_LOCAL
Definition: WebAssembly.h:87
llvm::WebAssemblyFrameLowering::RedZoneSize
static const size_t RedZoneSize
Size of the red zone for the user stack (leaf functions can use this much space below the stack point...
Definition: WebAssemblyFrameLowering.h:28
llvm::MachineFunction::getFunction
Function & getFunction()
Return the LLVM function that this machine code represents.
Definition: MachineFunction.h:521
llvm::MachineFunction::getTarget
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Definition: MachineFunction.h:551
MachineFrameInfo.h
llvm::Align::value
uint64_t value() const
This is a hole in the type system and should not be abused.
Definition: Alignment.h:85
llvm::TargetFrameLowering::DwarfFrameBase::Location
union llvm::TargetFrameLowering::DwarfFrameBase::@215 Location
WebAssemblySubtarget.h
llvm::WebAssemblyFrameLowering::hasFP
bool hasFP(const MachineFunction &MF) const override
Return true if the specified function should have a dedicated frame pointer register.
Definition: WebAssemblyFrameLowering.cpp:54
llvm::WebAssemblyFunctionInfo::isFrameBaseVirtual
bool isFrameBaseVirtual() const
Definition: WebAssemblyMachineFunctionInfo.h:114
llvm::WebAssemblyFrameLowering::needsPrologForEH
bool needsPrologForEH(const MachineFunction &MF) const
Definition: WebAssemblyFrameLowering.cpp:92
llvm::MCAsmInfo::getExceptionHandlingType
ExceptionHandling getExceptionHandlingType() const
Definition: MCAsmInfo.h:672
llvm::MachineFrameInfo
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Definition: MachineFrameInfo.h:107
llvm::MachineBasicBlock::begin
iterator begin()
Definition: MachineBasicBlock.h:268
MachineInstrBuilder.h
llvm::BuildMI
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
Definition: MachineInstrBuilder.h:329
llvm::WebAssemblyFrameLowering::getOpcGlobGet
static unsigned getOpcGlobGet(const MachineFunction &MF)
Definition: WebAssemblyFrameLowering.cpp:164
llvm::MachineFunction::createExternalSymbolName
const char * createExternalSymbolName(StringRef Name)
Allocate a string and populate it with the given external symbol name.
Definition: MachineFunction.cpp:495
llvm::MachineFrameInfo::hasStackMap
bool hasStackMap() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition: MachineFrameInfo.h:378
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
MachineFunction.h
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::WebAssemblyFunctionInfo::getFrameBaseLocal
unsigned getFrameBaseLocal() const
Definition: WebAssemblyMachineFunctionInfo.h:116
Debug.h
llvm::MachineBasicBlock::end
iterator end()
Definition: MachineBasicBlock.h:270